[ { "id": "f4f323db.8181f8", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "3b393ef1.2b322a", "type": "ctrlx-config", "name": "ctrlXCORE", "hostname": "localhost", "debug": false }, { "id": "4f43a716.eba098", "type": "ctrlx-config-subscription", "device": "3b393ef1.2b322a", "name": "Sub OPC UA Client State", "publishIntervalMs": "" }, { "id": "95eedbc4.8f71f", "type": "debug", "z": "f4f323db.8181f8", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 870, "y": 220, "wires": [] }, { "id": "8e7e0c8e.d42da8", "type": "switch", "z": "f4f323db.8181f8", "name": "Switch", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "{\"state\":\"CONNECTED\"}", "vt": "str" }, { "t": "eq", "v": "{\"state\":\"DISCONNECTED\"}", "vt": "str" } ], "checkall": "true", "repair": true, "outputs": 2, "x": 650, "y": 260, "wires": [ [ "95eedbc4.8f71f" ], [ "c809905d.49f848" ] ] }, { "id": "bc59e2fa.e7f1a", "type": "json", "z": "f4f323db.8181f8", "name": "JSON to String", "property": "payload", "action": "", "pretty": false, "x": 480, "y": 260, "wires": [ [ "8e7e0c8e.d42da8" ] ] }, { "id": "610fa792.374e8", "type": "ctrlx-datalayer-request", "z": "f4f323db.8181f8", "device": "3b393ef1.2b322a", "method": "WRITE", "path": "opcuaclient/client1/connect", "payloadFormat": "value_type", "name": "Connect OPC UA Client", "x": 1110, "y": 280, "wires": [ [] ] }, { "id": "c809905d.49f848", "type": "change", "z": "f4f323db.8181f8", "name": "Clear msg.payload", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 870, "y": 280, "wires": [ [ "610fa792.374e8" ] ] }, { "id": "aea35926.b7ce28", "type": "ctrlx-datalayer-subscribe", "z": "f4f323db.8181f8", "subscription": "4f43a716.eba098", "path": "opcuaclient/client1/state", "name": "Sub OPC UA Client Connection Status", "x": 230, "y": 260, "wires": [ [ "bc59e2fa.e7f1a" ] ] }, { "id": "6571a58c.ee14f4", "type": "comment", "z": "f4f323db.8181f8", "name": "Sub Connection Status OPC UA Client", "info": "This Node subscribes to the ctrlX Data Layer path \"opcuaclient/client1/state\" to read the current status and give it back as json object ", "x": 230, "y": 220, "wires": [] }, { "id": "625a117d.50dbe8", "type": "comment", "z": "f4f323db.8181f8", "name": "JSON to String", "info": "This Node converts the JSON Object to a string", "x": 480, "y": 220, "wires": [] }, { "id": "7399ec56.b47b34", "type": "comment", "z": "f4f323db.8181f8", "name": "Switch", "info": "This Node makes a switch case wehther the OPC UA Client is connected or not", "x": 650, "y": 220, "wires": [] }, { "id": "d5ff7bd5.a031c8", "type": "comment", "z": "f4f323db.8181f8", "name": "Clear msg.payload", "info": "This Node is the not connected case of the switch before and clears the msg object of the flow, because in the next coming node, a write function to the data laye node \"opcuaclient/client1/connect\" must be performed to connet the OPC UA Client the the configured OPC UA Server ", "x": 870, "y": 320, "wires": [] }, { "id": "714985f4.0dde1c", "type": "comment", "z": "f4f323db.8181f8", "name": "Connect OPC UA Client", "info": "A write command is performed to the data layer path \"opcuaclient/client1/connect\" to do a connection to the configured OPC UA Server", "x": 1100, "y": 240, "wires": [] }, { "id": "ca165fb0.9ac5a8", "type": "comment", "z": "f4f323db.8181f8", "name": "IMPORTANT! READ FIRST!", "info": "This flow was created based on the ctrlX AUTOMATION Software Release RM21.07 (1.10) \nYou might have to change the loging data of the data layer conntection in the ctrlX Data Layer Nodes if anything does not work\nIn the test case an internal OPC UA connection was used betwenn the OPC UA Server App and the OPC UA Client App of the ctrlX CORE\nIMPROTANT: This only works if you defined an OPC UA Connection string which works in the OPC UA Client App via the data layer before!", "x": 280, "y": 120, "wires": [] } ]