Hi folks,
I'm working on a project to upload var values to cloud.
Values are readed from PLC and are stored in global context as an object.
Then, with multiple injects, one for object variable, the data is uploaded to cloud. We have a lot of object variables on global context, and the upload to cloud interval it's diferent depending on the type of variable.
The problem I've is that upload ratio is limmited to 60 messages for minute.
So, I need to "push" diferrent global context variable values to one array. I know how to do it with a function, but I would like to know if there is a way to do it keeping my individual inject nodes.
I attach 5' Tab code:
[{"id":"daa38c3b.2e26","type":"tab","label":"JSON 5'","disabled":true,"info":""},{"id":"19036749.73e199","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHA3","payload":"PHA3","payloadType":"global","x":160,"y":80,"wires":[["b06f4715.7685d8"]]},{"id":"b06f4715.7685d8","type":"function","z":"daa38c3b.2e26","name":"Json Tango Value","func":"var DataVar=[msg.payload.Value];\nvar dateMA=global.get(\"dateMA\");\nvar body='{\"ID\":\"'+msg.topic+'\",\"TS\":\"'+dateMA+'\",\"ST\":\"0\",\"VR\":['+DataVar+']}'; \nmsg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\nmsg.headers['Authorization'] = global.get(\"MAToquen\");\nmsg.payload = body;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":80,"wires":[["40a8a5d4.48f97c","6c962859.14c038"]]},{"id":"40a8a5d4.48f97c","type":"debug","z":"daa38c3b.2e26","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1050,"y":40,"wires":[]},{"id":"9ce788d8.a33d48","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHA1","payload":"PHA1","payloadType":"global","x":160,"y":120,"wires":[["b06f4715.7685d8"]]},{"id":"2dab3be.2906ac4","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BNBA3","payload":"BNBA3","payloadType":"global","x":160,"y":860,"wires":[["56133387.8249cc"]]},{"id":"990fde0e.cc45","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BHCA3","payload":"BHCA3","payloadType":"global","x":160,"y":900,"wires":[["56133387.8249cc"]]},{"id":"d6ee5e9a.a00f6","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BNBB1","payload":"BNBB1","payloadType":"global","x":160,"y":940,"wires":[["56133387.8249cc"]]},{"id":"69fd2c4c.cf1904","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BHCB1","payload":"BHCB1","payloadType":"global","x":160,"y":980,"wires":[["56133387.8249cc"]]},{"id":"91976c5d.76eac","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BNBA1","payload":"BNBA1","payloadType":"global","x":160,"y":1020,"wires":[["56133387.8249cc"]]},{"id":"36205b9d.5eaed4","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BHCA1","payload":"BHCA1","payloadType":"global","x":160,"y":1060,"wires":[["56133387.8249cc"]]},{"id":"a35f0c0a.2d712","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BNBA2","payload":"BNBA2","payloadType":"global","x":160,"y":1100,"wires":[["56133387.8249cc"]]},{"id":"56133387.8249cc","type":"function","z":"daa38c3b.2e26","name":"Json Tango Amp","func":"var DataVar=[msg.payload.Amp];\nvar dateMA=global.get(\"dateMA\");\nvar body='{\"ID\":\"'+msg.topic+'\",\"TS\":\"'+dateMA+'\",\"ST\":\"0\",\"VR\":['+DataVar+']}'; \nmsg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\nmsg.headers['Authorization'] = global.get(\"MAToquen\");\nmsg.payload = body;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":860,"wires":[["6c962859.14c038"]]},{"id":"8bf4aafd.e5ead8","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHA6","payload":"PHA6","payloadType":"global","x":160,"y":160,"wires":[["b06f4715.7685d8"]]},{"id":"5005c91c.747798","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHB1","payload":"PHB1","payloadType":"global","x":160,"y":200,"wires":[["b06f4715.7685d8"]]},{"id":"b17424d5.58e188","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHB2","payload":"PHB2","payloadType":"global","x":160,"y":240,"wires":[["b06f4715.7685d8"]]},{"id":"7d971b3a.4f75a4","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHA4","payload":"PHA4","payloadType":"global","x":160,"y":280,"wires":[["b06f4715.7685d8"]]},{"id":"a1e7f6da.6776b8","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHA2","payload":"PHA2","payloadType":"global","x":160,"y":320,"wires":[["b06f4715.7685d8"]]},{"id":"aa6f28ec.94e708","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHA5","payload":"PHA5","payloadType":"global","x":160,"y":360,"wires":[["b06f4715.7685d8"]]},{"id":"52ccccb3.356204","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PHC1","payload":"PHC1","payloadType":"global","x":160,"y":400,"wires":[["b06f4715.7685d8"]]},{"id":"7da27b0a.8623a4","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF1","payload":"PTF1","payloadType":"global","x":150,"y":440,"wires":[["b06f4715.7685d8"]]},{"id":"bc391f26.f3454","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF9","payload":"PTF9","payloadType":"global","x":150,"y":480,"wires":[["b06f4715.7685d8"]]},{"id":"83194885.817f48","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF2","payload":"PTF2","payloadType":"global","x":150,"y":520,"wires":[["b06f4715.7685d8"]]},{"id":"697f56ad.54be18","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF3","payload":"PTF3","payloadType":"global","x":150,"y":560,"wires":[["b06f4715.7685d8"]]},{"id":"60b21316.483e0c","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF4","payload":"PTF4","payloadType":"global","x":150,"y":600,"wires":[["b06f4715.7685d8"]]},{"id":"3d403469.ddaa1c","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF5","payload":"PTF5","payloadType":"global","x":150,"y":640,"wires":[["b06f4715.7685d8"]]},{"id":"38876e41.af51f2","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF6","payload":"PTF6","payloadType":"global","x":150,"y":680,"wires":[["b06f4715.7685d8"]]},{"id":"d37ed1be.b090a","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF7","payload":"PTF7","payloadType":"global","x":150,"y":720,"wires":[["b06f4715.7685d8"]]},{"id":"a694769b.34e4d8","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"PTF8","payload":"PTF8","payloadType":"global","x":150,"y":760,"wires":[["b06f4715.7685d8"]]},{"id":"7d3b9612.24dc38","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BHCA2","payload":"BHCA2","payloadType":"global","x":160,"y":1140,"wires":[["56133387.8249cc"]]},{"id":"c7a21838.5388d8","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"BHCC1","payload":"BHCC1","payloadType":"global","x":160,"y":1180,"wires":[["56133387.8249cc"]]},{"id":"4d381bef.f65954","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V1A","payload":"V1A","payloadType":"global","x":150,"y":1220,"wires":[["56133387.8249cc"]]},{"id":"b6437a79.fc3668","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V1B","payload":"V1B","payloadType":"global","x":150,"y":1260,"wires":[["56133387.8249cc"]]},{"id":"a7cf06b9.c06668","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V1C","payload":"V1C","payloadType":"global","x":150,"y":1300,"wires":[["56133387.8249cc"]]},{"id":"a8603974.303a78","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V1AP","payload":"V1AP","payloadType":"global","x":160,"y":1340,"wires":[["56133387.8249cc"]]},{"id":"9439a537.990058","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V1BP","payload":"V1BP","payloadType":"global","x":160,"y":1380,"wires":[["56133387.8249cc"]]},{"id":"c082b5f9.f5eca8","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V1CP","payload":"V1CP","payloadType":"global","x":160,"y":1420,"wires":[["56133387.8249cc"]]},{"id":"642cae61.cafcd","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V2","payload":"V2","payloadType":"global","x":150,"y":1460,"wires":[["56133387.8249cc"]]},{"id":"c4758ac1.f31098","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V3","payload":"V3","payloadType":"global","x":150,"y":1500,"wires":[["56133387.8249cc"]]},{"id":"1fabfd80.c56783","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V4","payload":"V4","payloadType":"global","x":150,"y":1540,"wires":[["56133387.8249cc"]]},{"id":"9b3f3a82.270268","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V5","payload":"V5","payloadType":"global","x":150,"y":1580,"wires":[["56133387.8249cc"]]},{"id":"3a41ef7e.7093e","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V6","payload":"V6","payloadType":"global","x":150,"y":1620,"wires":[["56133387.8249cc"]]},{"id":"5b0be1f5.8fbd9","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V7","payload":"V7","payloadType":"global","x":150,"y":1660,"wires":[["56133387.8249cc"]]},{"id":"1bdd42f6.131c4d","type":"inject","z":"daa38c3b.2e26","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"V8","payload":"V8","payloadType":"global","x":150,"y":1700,"wires":[["56133387.8249cc"]]},{"id":"6c962859.14c038","type":"link out","z":"daa38c3b.2e26","name":"MA 5' TO HTTP REQUEST","links":["e2a7c72b.f684a8"],"x":995,"y":80,"wires":[]}]
Looking the node, what I want is to output an array with values of PHA3, PHA1, PHA6..., like this [PHA3value,PHA1value,PHA6value,...], keeping the individual injects. It's possible?
Thanks in advance.