Wiki source code of OPC UA
Last modified by Devin Chen on 2025/12/05 09:18
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | = OPC UA Client = |
| 2 | |||
| 3 | This document describes the communication between Wecon HMI PI8150ig and LX6C-0808MT-DB Ethernet OPC UA, the PLC as Server and the HMI as Client. | ||
| 4 | |||
| 5 | **OPC UA Server Setting** | ||
| 6 | |||
| 7 | 1)Add [Symbol Configuration] | ||
| 8 | |||
| 9 | (% style="text-align:center" %) | ||
| |
2.1 | 10 | [[image:1718694163624-376.png||height="574" width="600"]] |
| |
1.1 | 11 | |
| 12 | 2)The option [Support OPC UA features] is enabled by default, do not change it, and then click [Add]; | ||
| 13 | |||
| 14 | (% style="text-align:center" %) | ||
| |
2.1 | 15 | [[image:1718694187203-702.png||height="692" width="500"]] |
| |
1.1 | 16 | |
| 17 | 3)Click [Build] to compile the project; | ||
| 18 | |||
| 19 | (% style="text-align:center" %) | ||
| |
2.1 | 20 | [[image:1718694206493-877.png||height="478" width="900"]] |
| |
1.1 | 21 | |
| 22 | 4)Tick the boxes for POU node to make all variables are accessible from OPC clients; | ||
| 23 | |||
| 24 | (% style="text-align:center" %) | ||
| |
2.1 | 25 | [[image:1718694223959-314.png||height="478" width="900"]] |
| |
1.1 | 26 | |
| 27 | |||
| 28 | **HMI Settings** | ||
| 29 | |||
| 30 | (% style="margin-left:auto; margin-right:auto" %) | ||
| 31 | |=**Items**|=**Settings**|=**Note** | ||
| 32 | |Protocol|OPC_UA_Client| | ||
| 33 | |Connection|Ethernet| | ||
| 34 | |Port No.|4840| | ||
| 35 | |PLC station No.|1| | ||
| 36 | |||
| 37 | (% class="box infomessage" %) | ||
| 38 | ((( | ||
| 39 | **✎**Note: Only 8000ig Series support OPC UA Client. | ||
| 40 | ))) | ||
| 41 | |||
| 42 | 1)[New]→[setting]→[communication device]:[communication]Ethernet, [Protocol]Ethernet1, [Device type]OPCUA,[Protocol]OPC_UA_Client→[OK] | ||
| 43 | |||
| 44 | (% style="text-align:center" %) | ||
| 45 | [[image:1718692090272-964.png]] | ||
| 46 | |||
| 47 | 2)Set the [Device IP] as Server IP:[Server IP]192.168.8.8,[Porta]4840.If you set the account of server,you need enter the [Username] and [Password] in the appropriate places. | ||
| 48 | |||
| 49 | (% style="text-align:center" %) | ||
| 50 | [[image:1718692350491-886.png]] | ||
| 51 | |||
| 52 | 3)Enter [Labels manage],click[Get Tags From Device] | ||
| 53 | |||
| 54 | (% style="text-align:center" %) | ||
| 55 | [[image:1718692618961-813.png]] | ||
| 56 | |||
| 57 | Choose the tags we need:[Root]-[Objects]-[DeviceSet]-[LX6C-0808MT-DD]-[Resources]-[Application]-[Programs].Then click[Add],and[Save]. | ||
| 58 | |||
| 59 | (% style="text-align:center" %) | ||
| 60 | [[image:123.png]] | ||
| 61 | |||
| 62 | 4)Then you can use these tags in the HMI. | ||
| 63 | |||
| 64 | (% style="text-align:center" %) | ||
| |
2.1 | 65 | [[image:1718692728268-946.png||height="434" width="764"]] |
| |
1.1 | 66 | |
| 67 | |||
| |
2.1 | 68 | = OPC UA Server = |
| |
1.1 | 69 | |
| |
2.1 | 70 | **HMI Settings** |
| 71 | |||
| 72 | 1) [FUNCTION CONFIGURATION] →[OPC UA server] →Enable OPC UA Server | ||
| 73 | |||
| 74 | (% style="text-align:center" %) | ||
| 75 | [[image:Picture1.png||height="563" width="870"]] | ||
| 76 | |||
| 77 | 2) After enabling the OPC UA server, a configuration interface for the OPC UA server-related properties will pop up. | ||
| 78 | |||
| 79 | (% style="text-align:center" %) | ||
| 80 | [[image:Picture2.png||height="760" width="852"]] | ||
| 81 | |||
| 82 | **Description**: Enter a description or remarks about the OPC | ||
| 83 | |||
| 84 | **OPC TCP**: Set the server's URL address | ||
| 85 | |||
| 86 | **Port**: Set the port number for client interaction, default is 4840 | ||
| 87 | |||
| 88 | **Server Name**: Enter the name of the server, which can be left blank | ||
| 89 | |||
| 90 | **Security Strategy**: This refers to the security policies provided by OPC UA. The OPC UA server offers four security policies and three authentication methods, allowing different encryption approaches through various combinations | ||
| 91 | |||
| 92 | {{info}} | ||
| 93 | The settings and delete options only apply to newly added tags and groups, not to the default groups. | ||
| 94 | {{/info}} | ||
| 95 | |||
| 96 | 3) Authentication: | ||
| 97 | |||
| 98 | (% style="text-align:center" %) | ||
| 99 | [[image:Picture3.png||height="687" width="524"]] | ||
| 100 | |||
| 101 | **Anonymous: **Select the permissions for client interaction when using anonymous login, including three types: browse, read, and write | ||
| 102 | |||
| 103 | **Username_Password: **The username and password here are equivalent to those set on the [Project Configuration\User Permission] page. When a client logs into the server using a username and password, if the user’s group level matches the server configuration, they will have the corresponding permissions | ||
| 104 | |||
| 105 | 4) Tag configuration | ||
| 106 | |||
| 107 | (% style="text-align:center" %) | ||
| 108 | [[image:1764897460407-402.png||height="540" width="767"]] | ||
| 109 | |||
| 110 | **Tag:** Displays the defined tags | ||
| 111 | |||
| 112 | **Add Group:** Add a new group to manage tags | ||
| 113 | |||
| 114 | **Add Tag:** Add the address tags you want to monitor; the name cannot be empty | ||
| 115 | |||
| 116 | **Setting:** When a tag is selected, clicking this will navigate to the tag configuration interface. When a group is selected, clicking this will configure the group name | ||
| 117 | |||
| 118 | **Delete:** Can delete added tags or groups | ||
| 119 | |||
| 120 | **Name:** Tag Name | ||
| 121 | |||
| 122 | **Type:** Indicates the Readable/Writable attributes of the tag, with "Readable" selected by default | ||
| 123 | |||
| 124 | **Address:** Configures the address the tag is intended to monitor | ||
| 125 | |||
| 126 | **Data Type:** Indicates the data type of the tag | ||
| 127 | |||
| 128 | **Array Length:** When set to a value greater than 1, it indicates that the tag is an array, with a valid range of 1~~255 | ||
| 129 | |||
| 130 | (% style="text-align:center" %) | ||
| 131 | [[image:1764897518846-171.png]] |