OPC UA Client
Basic Usage
To start, we’ll connect to an OPC UA server to receive values from. Double click the app in the explorer to begin configuration.
In the General settings tab, check off the “Enable” option.
Create a folder, then create a Server Connection object inside that folder. Add the necessary info for an OPC UA server you would like to connect to.
Create a Server Item Group object inside the Server Connection object.
Create Server Item objects inside the Server Item Group for server items you would like to receive data from.
Now, run the Start command to start the client.
To view client activity, open up
OPCUAClient.login the Logger. When OPC UA Client receives an update from a subscribed value, a read request for values, or a write request for values, they will show up in the logs.
Security
To create an encrypted connection to an OPC UA server, select the desired Security Mode and Security Policy on a server configuration.
Save the changes and restart the app.
If the server you are connecting to does not recognize OPC UA Client’s certificate, then you’ll see errors in your logs that look something like this. This is normal behavior for first time connections.
On the OPC UA server you’re trying to connect to, you’ll see a quarantined client certificate called
AUTOSOL OPC UA Client. Verify the SHA-1 hash of the certificate matches the hash of OPC UA Client’s certificate, then trust the certificate on the server.An example OPC UA server. Note the SHA-1 hash of the quarantined certificate.You can verify the SHA-1 hash of the certificate the server received to the hash displayed in Manage Certificates.Restart the app. If OPC UA Client does not recognize the server certificate, you will see log entries that indicate that the server certificate was rejected.
In the Manage Certificates tab, you will see the server certificate in the Quarantined Server Certificates section. If it does not show up, click the Refresh button in the top left corner. Then follow the steps below to trust the server certificate.
2. The server certificate should appear, verify its hash is correct
3. If it is correct, select “Trust” in the “Actions?” column
4. Click the Save button to trust the server certificate
Once the client and server certificates have been trusted by both parties, you can restart OPC UA Client. In the logs, you should see that the client successfully validates the server certificate and creates a connection, after which you should see values being polled.
Alternatively, in order to exchange certificates between OPC UA Client and an OPC UA server, you can also directly upload the server certificate to OPC UA Client, as well as download OPC UA Client’s certificate to upload to an OPC UA server.
Supported Data Types
OPC UA Client supports the following OPC data types:
Type | Description |
|---|---|
Boolean | A two-state logical value (true or false). |
SByte | An integer value between −128 and 127 inclusive. |
Byte | An integer value between 0 and 255 inclusive. |
Int16 | An integer value between −32 768 and 32 767 inclusive. |
UInt16 | An integer value between 0 and 65 535 inclusive. |
Int32 | An integer value between −2 147 483 648 and 2 147 483 647 inclusive. |
UInt32 | An integer value between 0 and 4 294 967 295 inclusive. |
Int64 | An integer value between −9 223 372 036 854 775 808 and 9 223 372 036 854 775 807 inclusive. |
UInt64 | An integer value between 0 and 18 446 744 073 709 551 615 inclusive. |
Float | An IEEE single precision (32 bit) floating point value. |
Double | An IEEE double precision (64 bit) floating point value. |
String | A sequence of Unicode characters. |
DateTime | An instance in time. |
LocalizedText | Human readable text with an optional locale identifier. |
Metadata
Like Edge ACM, OPC UA Client supports metadata properties for Server Item objects, which are similar to Tag objects in Edge ACM. The functionality is identical, so you can follow the existing guide on metadata properties here: Metadata Properties