Page 1 of 1

[Development Mode] Create Read/Write OpcUA Client flow

Posted: Wed Dec 14, 2022 6:00 am
by IoTStudio Support
  • Prepare a OpcUa Server
    From AIoT Cloud free download AIC Opc Ua and install on same machine with AIC IoT Studio.
    IoTStudio+OpcUaServer.PNG
    IoTStudio+OpcUaServer.PNG (48.63 KiB) Viewed 5671 times
    AIC OpcUa Server default node config has Demo object. You use UaExpert to check it, look like below.
    DemoObject.PNG
    DemoObject.PNG (19.99 KiB) Viewed 5670 times
    I will read/write the Int32_Var01 item on IoT Studio.
  • Launch IoT Studio Development Mode
    • Move mouse cursor to IoT Studio Utility Development Mode Status URL and click right button to copy URL.
      IoTStudio.CopyURL.PNG
      IoTStudio.CopyURL.PNG (18.32 KiB) Viewed 5670 times
    • Launch browser (chrome or edge) and paste URL to open Development Mode.
    • Login default account/password admin/admin
      IoTStudio.DevLogin.PNG
      IoTStudio.DevLogin.PNG (10.55 KiB) Viewed 5670 times
    • Pull OpcUa-Client node and configure Endpoint with AIC OpcUa Server UA TCP and Action READ
      IoTStudio.OpcUaEndpoint.PNG
      IoTStudio.OpcUaEndpoint.PNG (13.43 KiB) Viewed 5669 times
      IoTStudio.OpcUaEditNode.PNG
      IoTStudio.OpcUaEditNode.PNG (17.96 KiB) Viewed 5669 times
    • Pull OpcUa-Item node and configure Item with the Int32_Var01 item's nodeId ns=2;j=6003. The nodeId can check from UaExpert
      IoTStudio.nodeId.PNG
      IoTStudio.nodeId.PNG (47.45 KiB) Viewed 5668 times
      IoTStudio.OpcUaItemConfigure.PNG
      IoTStudio.OpcUaItemConfigure.PNG (8.24 KiB) Viewed 5668 times
    • Pull relative nodes for read and write flow and results
      IoTStudio.result.PNG
      IoTStudio.result.PNG (33.21 KiB) Viewed 5668 times
      The flow code:

      Code: Select all

      [{"id":"eb5f53b859c3bef8","type":"OpcUa-Client","z":"c91170df697f7731","endpoint":"0c5909117e611543","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","folderName4PKI":"","name":"OpcUA Server READ ","x":540,"y":60,"wires":[["77e292edf43c49bb"]]},{"id":"01d189e4c5956a12","type":"OpcUa-Item","z":"c91170df697f7731","item":"ns=2;i=6003","datatype":"Int32","value":"","name":"Int32_Var01","x":350,"y":60,"wires":[["eb5f53b859c3bef8"]]},{"id":"77e292edf43c49bb","type":"debug","z":"c91170df697f7731","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":60,"wires":[]},{"id":"62373a9f61076423","type":"inject","z":"c91170df697f7731","name":"Read Int32_Var01","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":60,"wires":[["01d189e4c5956a12"]]},{"id":"56f793bb464c5328","type":"OpcUa-Item","z":"c91170df697f7731","item":"ns=2;i=6003","datatype":"Int32","value":"","name":"Int32_Var01","x":350,"y":120,"wires":[["9b23d6d5b5bd54d6"]]},{"id":"d968552a3f4e10b5","type":"inject","z":"c91170df697f7731","name":"Write Int32_Var01 123","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"123","payloadType":"num","x":160,"y":120,"wires":[["56f793bb464c5328"]]},{"id":"9b23d6d5b5bd54d6","type":"OpcUa-Client","z":"c91170df697f7731","endpoint":"0c5909117e611543","action":"write","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","folderName4PKI":"","name":"OpcUA Server WRITE","x":540,"y":120,"wires":[["76ee9391d78ee9ef"]]},{"id":"76ee9391d78ee9ef","type":"debug","z":"c91170df697f7731","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":120,"wires":[]},{"id":"0c5909117e611543","type":"OpcUa-Endpoint","endpoint":"opc.tcp://DESKTOP-L6IIIJ3:48010","secpol":"None","secmode":"None","none":true,"login":false,"usercert":false,"usercertificate":"","userprivatekey":""}]