Connecting a Client to the OPC UA Server
To test the provided OPC UA server plug-in, you have to add the server to your OPC UA client. For our documentation, we will make use of the UaExpert® client, a full-featured OPC UA client that can be used for test purposes and can be downloaded from the Unified Automation website. However, you can use any OPC UA client of your choice.
Connecting an OPC UA Client to the OPC UA Server
This section describes how to manually add a new server to an OPC UA client. We will demonstrate this using the UaExpert® client. However, for other OPC UA clients, the procedure how to add a server should be similar.
- Open UaExpert®. If you run the client for the first time, you may need to provide information to create a certificate for the client.
- Click on the “+” button in the toolbar. A new dialog opens for the server settings.
- Go to the "Advanced" tab and specify the configuration for the server.
- Add the endpoint URL. It must be given in the format "opc.tcp://<IP or host name>:<port>". You have to specify the IP or the host name of the device where the server is running and the port number where the server is listening for requests. If you are running the server locally, you can specify the endpoint URL as follows: "opc.tcp://localhost:48010".
- Select the security policy. By default, you can use either "Basic256Sha256", "Aes128-Sha256-RsaOaep", or "Aes256-Sha256-RsaPss".
You also have the possibility to use other security policies or none at all. If you are testing the connection to the server, you can choose "None" to connect to the server without any security settings. However, you first have to enable the desired security policy in the server configuration file. Otherwise an error will occur when connecting to the server because the selected security policy is not enabled in the configuration of the server. For more information about the configuration parameters for the endpoint connection, see the topic Configuring the OPC UA Server.
- Optionally, specify a name for the server configuration, e.g., "MERLIC-Vision", at the top of the window.
- Save the configuration by clicking on the "OK" button. In our example, the server configuration is now set to listen to clients on the port "48010" and uses the security policy "Basic256Sha256".
If you specified a security policy other than "None" for the first time, you have to add the respective security certificate to the location of trusted certificates.
When connecting the client to the OPC UA server, the server generates and sends a certificate to the client. In the client, e.g., UaExpert®, you have to confirm that you trust this certificate from the server. The client will then send a security certificate to the OPC UA server, which stores the certificate automatically into the directory that has been defined in the server configuration at the parameter "Rejected certificate location". By default, the path for the rejected certificates is set to "%AppData%/MVTec/Communicator/OPC_UA/Certificate_Store/rejected/" on Windows systems and to "~/.local/share/MVTec/Communicator/OPC_UA/Certificate_Store/rejected/" on Linux systems.
To add the file to the location of the trusted certificates, copy the file to the directory for trusted certificates, i.e., into the directory defined in the server configuration at the parameter "Certificate trust list location". By default, the path for trusted certificates is set to "%AppData%/MVTec/Communicator/OPC_UA/Certificate_Store/trusted/certs/" on Windows systems and to "~/.local/share/MVTec/Communicator/OPC_UA/Certificate_Store/trusted/certs/" on Linux systems. Now, you can start the connection with the server and for future changes at the security policy of your configuration, this step will not be necessary anymore.
- If everything was set correctly the server connection now appears in the "Project" window.

- If you want to change the configuration again, open the "Properties" dialog via the context menu of the server.
- Save the project with your server configuration via the menu entry "File > Save As".
In the next step, you can start the connection to the OPC UA server as described in the topic Setting Up the OPC UA Server with MERLIC.


