Skip to content

Instantly share code, notes, and snippets.

@mikakaraila
Created January 17, 2016 13:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikakaraila/a83207579ba95737ef15 to your computer and use it in GitHub Desktop.
Save mikakaraila/a83207579ba95737ef15 to your computer and use it in GitHub Desktop.
OPC UA nodes

Node-red nodes for:

OPC UA client OPC UA item OPC UA server OPC UA browse (reads actually local file) OPC UA client node keeps up session that is then used for actions:

Read Write Browse (output to console and debug panel, Subscribe Tested with IGSS (Schneider) Scada demo system.

[{"type":"tab","id":"39bb936b.c6446c","label":"IGSS OPC UA Tests"},{"id":"da070375.25f9","type":"OpcUaClient","endpoint":"opc.tcp://localhost:12403/IGSS/IGSSOpcUaServer","action":"browse","time":10000,"name":"Browse","x":249,"y":171,"z":"39bb936b.c6446c","wires":[["22f1b124.dd0e4e"]]},{"id":"dbdd4f89.2422b","type":"inject","name":"Test","topic":"ns=2;s=0:IGSS Objects/(All)","payload":"","payloadType":"string","repeat":"","crontab":"","once":false,"x":95,"y":169,"z":"39bb936b.c6446c","wires":[["da070375.25f9"]]},{"id":"22f1b124.dd0e4e","type":"debug","name":"Browse","active":true,"console":"false","complete":"payload","x":446,"y":169,"z":"39bb936b.c6446c","wires":[]},{"id":"260b14a1.d9f4ec","type":"OpcUaItem","item":"ns=2;s=1:PST-007-Alarm-Level@Training?VALUE","datatype":"double","value":"","name":"","x":398,"y":283,"z":"39bb936b.c6446c","wires":[["645769f6.9ba898"]]},{"id":"645769f6.9ba898","type":"OpcUaClient","endpoint":"opc.tcp://localhost:12403/IGSS/IGSSOpcUaServer","action":"read","time":10000,"name":"Read","x":670,"y":320,"z":"39bb936b.c6446c","wires":[["f1d9e189.0e262"]]},{"id":"f1d9e189.0e262","type":"debug","name":"Read","active":true,"console":"false","complete":"payload","x":790,"y":320,"z":"39bb936b.c6446c","wires":[]},{"id":"5cd8ccf6.a32734","type":"inject","name":"Test read","topic":"","payload":"browse","payloadType":"none","repeat":"","crontab":"","once":false,"x":107,"y":259,"z":"39bb936b.c6446c","wires":[["260b14a1.d9f4ec","6e5c856a.91a37c","cf097a14.30f688","16c45bc1.e93ba4"]]},{"id":"3759f01f.c8a61","type":"OpcUaItem","item":"ns=2;s=1:PST-007-Alarm-Level@Training?SETPOINT","datatype":"Double","value":"","name":"","x":406,"y":447,"z":"39bb936b.c6446c","wires":[["fd98da51.026728"]]},{"id":"fd98da51.026728","type":"OpcUaClient","endpoint":"opc.tcp://localhost:12403/IGSS/IGSSOpcUaServer","action":"write","time":10000,"name":"Write","x":677,"y":446,"z":"39bb936b.c6446c","wires":[["96a85190.6957b"]]},{"id":"96a85190.6957b","type":"debug","name":"Write","active":true,"console":"false","complete":"true","x":808,"y":447,"z":"39bb936b.c6446c","wires":[]},{"id":"f1f4ef37.0e0b1","type":"OpcUaClient","endpoint":"opc.tcp://localhost:12403/IGSS/IGSSOpcUaServer","action":"subscribe","time":"5000","name":"Subscribe","x":668,"y":223,"z":"39bb936b.c6446c","wires":[["d84a3b91.27b5c8"]]},{"id":"d84a3b91.27b5c8","type":"debug","name":"Subs","active":true,"console":"false","complete":"payload","x":800,"y":223,"z":"39bb936b.c6446c","wires":[]},{"id":"6e5c856a.91a37c","type":"OpcUaItem","item":"ns=2;s=1:PST-007-Alarm-Level@Training?HIGH_SCALE","datatype":"double","value":"","name":"","x":379,"y":318,"z":"39bb936b.c6446c","wires":[["645769f6.9ba898"]]},{"id":"cf097a14.30f688","type":"OpcUaItem","item":"ns=2;s=1:PST-007-Alarm-Level@Training?LOW_SCALE","datatype":"double","value":"","name":"","x":380,"y":352,"z":"39bb936b.c6446c","wires":[["645769f6.9ba898"]]},{"id":"bbd1a16a.442e6","type":"OpcUaItem","item":"ns=2;s=1:PST-007-Alarm-Level@Training?SETPOINT","datatype":"double","value":"4","name":"","x":385,"y":223,"z":"39bb936b.c6446c","wires":[["f1f4ef37.0e0b1"]]},{"id":"16fb4426.e904bc","type":"inject","name":"Test subs","topic":"","payload":"browse","payloadType":"none","repeat":"","crontab":"","once":false,"x":100,"y":223,"z":"39bb936b.c6446c","wires":[["bbd1a16a.442e6"]]},{"id":"b586aea4.4a795","type":"inject","name":"Test write 2.5","topic":"","payload":" 2.5","payloadType":"string","repeat":"","crontab":"","once":false,"x":105,"y":423,"z":"39bb936b.c6446c","wires":[["3759f01f.c8a61"]]},{"id":"a9e607b5.5619f8","type":"inject","name":"Test write 3.5","topic":"","payload":" 3.5","payloadType":"string","repeat":"","crontab":"","once":false,"x":102,"y":463,"z":"39bb936b.c6446c","wires":[["3759f01f.c8a61"]]},{"id":"16c45bc1.e93ba4","type":"OpcUaItem","item":"ns=2;s=1:PST-007-Alarm-Level@Training?SETPOINT","datatype":"double","value":"4","name":"","x":386,"y":386,"z":"39bb936b.c6446c","wires":[["645769f6.9ba898"]]},{"id":"1b2ace46.e4d532","type":"OpcUaClient","endpoint":"opc.tcp://localhost:12403/IGSS/IGSSOpcUaServer","action":"browse","time":10000,"name":"Browse","x":250,"y":94,"z":"39bb936b.c6446c","wires":[["5e038a81.a1fc74"]]},{"id":"6cd93d98.9326c4","type":"inject","name":"Test","topic":"ns=2;s=0:IGSS Objects/Area/Cases/Diagram/Boiler@Cases/Template","payload":"","payloadType":"string","repeat":"","crontab":"","once":false,"x":96,"y":92,"z":"39bb936b.c6446c","wires":[["1b2ace46.e4d532"]]},{"id":"22b737b4.dd48c8","type":"debug","name":"Browse","active":true,"console":"false","complete":"payload","x":600,"y":95,"z":"39bb936b.c6446c","wires":[]},{"id":"5e038a81.a1fc74","type":"template","name":"OpcUaItem","field":"payload","format":"handlebars","template":"[{\"id\":\"4b12ca9b.e7e184\",\"type\":\"OpcUaItem\",\"item\":\"{{topic}}\",\"datatype\":\"opcua.DataType.Double\",\"value\":\"\",\"name\":\"{{browseName}}\",\"x\":251,\"y\":334,\"z\":\"30ffd2ee.59fdd6\",\"wires\":[[\"70dd1397.3c8e44\"]]}]","x":411,"y":93,"z":"39bb936b.c6446c","wires":[["22b737b4.dd48c8"]]}]
@frilovic
Copy link

frilovic commented Aug 21, 2021

some changes have to be made in this flow several objects are not recognized, this flow is correct in 08/2021

[{"id":"a1335b6d.3941e8","type":"tab","label":"IGSS OPC UA Tests"}, {"id":"6137f677.d63148","type":"OpcUa-Client","z":"a1335b6d.3941e8","endpoint":"2ae37cc.09f3c84","action":"browse","deadbandvalue":"","time":10000,"localfile":"","localkeyfile":"","name":"Browse","x":249,"y":171,"wires":[["1af508cc.110457"]]}, {"id":"1e573dbd.898a32","type":"inject","z":"a1335b6d.3941e8","name":"Test","repeat":"","crontab":"","once":false,"topic":"ns=2;s=0:IGSS Objects/(All)","payload":"","payloadType":"string","x":95,"y":169,"wires":[["6137f677.d63148"]]}, {"id":"1af508cc.110457","type":"debug","z":"a1335b6d.3941e8","name":"Browse","active":true,"tosidebar":true,"console":false,"complete":"payload","statusVal":"","statusType":"auto","x":446,"y":169,"wires":[]}, {"id":"1846123a.b0041e","type":"OpcUa-Item","z":"a1335b6d.3941e8","item":"ns=2;s=1:PST-007-Alarm-Level@Training?VALUE","datatype":"double","value":"","name":"","x":380,"y":280,"wires":[["8f376b1b.79a9f8"]]}, {"id":"8f376b1b.79a9f8","type":"OpcUa-Client","z":"a1335b6d.3941e8","endpoint":"2ae37cc.09f3c84","action":"read","deadbandvalue":"","time":10000,"localfile":"","localkeyfile":"","name":"Read","x":670,"y":320,"wires":[["9f44e410.cc6868"]]}, {"id":"9f44e410.cc6868","type":"debug","z":"a1335b6d.3941e8","name":"Read","active":true,"console":"false","complete":"payload","x":990,"y":320,"wires":[]}, {"id":"7a3678d5.11c908","type":"inject","z":"a1335b6d.3941e8","name":"Test read","props":[{"p":"payload","v":"browse","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"browse","payloadType":"str","x":120,"y":300,"wires":[["1846123a.b0041e","776bbc2a.97d734","fe16e016.2c5da","d6742b33.16ca78"]]}, {"id":"8eea50d7.a2931","type":"OpcUa-Item","z":"a1335b6d.3941e8","item":"ns=2;s=1:PST-007-Alarm-Level@Training?SETPOINT","datatype":"Double","value":"","name":"","x":406,"y":447,"wires":[["a1750aab.b13cb8"]]}, {"id":"a1750aab.b13cb8","type":"OpcUa-Client","z":"a1335b6d.3941e8","endpoint":"2ae37cc.09f3c84","action":"write","deadbandvalue":"","time":10000,"localfile":"","localkeyfile":"","name":"Write","x":677,"y":446,"wires":[["13462c7a.9f7d94"]]}, {"id":"13462c7a.9f7d94","type":"debug","z":"a1335b6d.3941e8","name":"Write","active":true,"console":"false","complete":"true","x":808,"y":447,"wires":[]}, {"id":"e00430a4.8e9aa","type":"OpcUa-Client","z":"a1335b6d.3941e8","endpoint":"2ae37cc.09f3c84","action":"subscribe","deadbandvalue":"","time":"5000","localfile":"","localkeyfile":"","name":"Subscribe","x":668,"y":223,"wires":[["82681ce2.d28b2"]]}, {"id":"82681ce2.d28b2","type":"debug","z":"a1335b6d.3941e8","name":"Subs","active":true,"tosidebar":true,"console":false,"complete":"payload","statusVal":"","statusType":"auto","x":800,"y":223,"wires":[]}, {"id":"776bbc2a.97d734","type":"OpcUa-Item","z":"a1335b6d.3941e8","item":"ns=2;s=1:PST-007-Alarm-Level@Training?HIGH_SCALE","datatype":"double","value":"","name":"","x":379,"y":318,"wires":[["8f376b1b.79a9f8"]]}, {"id":"fe16e016.2c5da","type":"OpcUa-Item","z":"a1335b6d.3941e8","item":"ns=2;s=1:PST-007-Alarm-Level@Training?LOW_SCALE","datatype":"double","value":"","name":"","x":380,"y":352,"wires":[["8f376b1b.79a9f8"]]}, {"id":"ef6030cc.4af0b","type":"OpcUa-Item","z":"a1335b6d.3941e8","item":"ns=2;s=1:PST-007-Alarm-Level@Training?SETPOINT","datatype":"double","value":"4","name":"","x":385,"y":223,"wires":[["e00430a4.8e9aa"]]}, {"id":"7dcf9ad9.f4b564","type":"inject","z":"a1335b6d.3941e8","name":"Test subs","props":[{"p":"payload","v":"browse","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"browse","payloadType":"str","x":100,"y":223,"wires":[["ef6030cc.4af0b"]]}, {"id":"51ee2d87.31af84","type":"inject","z":"a1335b6d.3941e8","name":"Test write 2.5","props":[{"p":"payload","v":" 2.5","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":" 2.5","payloadType":"str","x":105,"y":423,"wires":[["8eea50d7.a2931"]]}, {"id":"1eecbe66.7b51b2","type":"inject","z":"a1335b6d.3941e8","name":"Test write 3.5","repeat":"","crontab":"","once":false,"topic":"","payload":" 3.5","payloadType":"string","x":102,"y":463,"wires":[["8eea50d7.a2931"]]}, {"id":"d6742b33.16ca78","type":"OpcUa-Item","z":"a1335b6d.3941e8","item":"ns=2;s=1:PST-007-Alarm-Level@Training?SETPOINT","datatype":"double","value":"4","name":"","x":386,"y":386,"wires":[["8f376b1b.79a9f8"]]}, {"id":"a463f86.b357108","type":"OpcUa-Client","z":"a1335b6d.3941e8","endpoint":"2ae37cc.09f3c84","action":"browse","deadbandvalue":"","time":10000,"localfile":"","localkeyfile":"","name":"Browse","x":280,"y":100,"wires":[["da0cbaba.d32f38"]]}, {"id":"cdbeb464.5d58a8","type":"inject","z":"a1335b6d.3941e8","name":"Test","repeat":"","crontab":"","once":false,"topic":"ns=2;s=0:IGSS Objects/Area/Cases/Diagram/Boiler@Cases/Template","payload":"","payloadType":"string","x":130,"y":100,"wires":[["a463f86.b357108"]]}, {"id":"94ad618f.9815b","type":"debug","z":"a1335b6d.3941e8","name":"Browse","active":true,"console":"false","complete":"payload","x":660,"y":100,"wires":[]}, {"id":"da0cbaba.d32f38","type":"template","z":"a1335b6d.3941e8","name":"OpcUaItem","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[{\"id\":\"4b12ca9b.e7e184\",\n\"type\":\"OpcUa-Item\",\"item\":\"{{topic}}\",\n\"datatype\":\"opcua.DataType.Double\",\"value\":\"\",\n\"name\":\"{{browseName}}\",\n\"x\":251,\"y\":334,\"z\":\"30ffd2ee.59fdd6\",\n\"wires\":[[\"70dd1397.3c8e44\"]]}]","x":470,"y":100,"wires":[["94ad618f.9815b"]]}, {"id":"2ae37cc.09f3c84","type":"OpcUa-Endpoint","endpoint":"opc.tcp://localhost:4840","secpol":"None","secmode":"None","login":false}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment