With node-RED v.3.0.2 using node-red-contrib-opcua v.0.2.289 I have tried to subscribe to one variable and device from an OPC-UA server using msg.topic of an injection node and all is right, receiving data from the subscription.
As I need about 20 variables (combining HValues and Values) from 16 devices I have decided not to do it individually but using node-red-contrib-loop-processing v.0.5.1 and a function node. In this case I am not successful. Can some one contribute with some help?
[{"id":"0a6d152430586c6e","type":"tab","label":"OPC UA subscriptions","disabled":false,"info":"","env":[]},{"id":"db84297ca9205371","type":"function","z":"0a6d152430586c6e","name":"Parametres","func":"msg.topic = [];\nvar una = '';\nvar sensors = ['NI_0044', 'NI_0078'];\nfor (let i = 8; i < 9; i++) {\n una = 'ns=2;s=DL' + '00'.substring(i.toString(10).length) + i;\n for (let sensor of sensors) {\n msg.topic.push(una + '.' + sensor + '.Value');\n msg.topic.push(una + '.' + sensor + '.HValue');}}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":120,"wires":[["88acce5167fb1216","c6d9b08839d3b782"]]},{"id":"92575b6cd58a8858","type":"inject","z":"0a6d152430586c6e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":120,"wires":[["db84297ca9205371"]]},{"id":"88acce5167fb1216","type":"debug","z":"0a6d152430586c6e","name":"debug 14","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1020,"y":80,"wires":[]},{"id":"c6d9b08839d3b782","type":"array-loop","z":"0a6d152430586c6e","name":"Cada parametre","key":"al6ba672f3823eea96","keyType":"msg","reset":true,"resetValue":"value-null","array":"topic","arrayType":"msg","x":1040,"y":120,"wires":[["9d5c911767fec06d"],["8205748b7616c874","04ddf73e2b6dde8a"]]},{"id":"9d5c911767fec06d","type":"debug","z":"0a6d152430586c6e","name":"debug 15","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1240,"y":100,"wires":[]},{"id":"a55fb040cf3288cb","type":"debug","z":"0a6d152430586c6e","name":"debug 16","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1220,"y":240,"wires":[]},{"id":"04ddf73e2b6dde8a","type":"OpcUa-Client","z":"0a6d152430586c6e","endpoint":"5e8523f827b31b5a","action":"subscribe","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","folderName4PKI":"","name":"","x":1040,"y":200,"wires":[["a55fb040cf3288cb","c6d9b08839d3b782"]]},{"id":"8205748b7616c874","type":"debug","z":"0a6d152430586c6e","name":"debug 17","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1240,"y":140,"wires":[]},{"id":"5e8523f827b31b5a","type":"OpcUa-Endpoint","endpoint":"opc.tcp://172.16.3.55:4840","secpol":"None","secmode":"None","none":false,"login":true,"usercert":false,"usercertificate":"","userprivatekey":""}]