Skip to content

OPC UA

Antti Haaraniemi

OPC UA client vs. server: what is the difference?

Summary

Every OPC UA connection has two ends. The server owns the data and offers it; the client opens the connection, browses, reads and subscribes. This article explains the two roles, the certificate exchange between them, and which end you need when you want data out of an automation system.

Ask an automation supplier whether a system "has OPC UA" and the answer is usually yes. That still does not tell you which end the system has. OPC UA server and OPC UA client are two roles in the same connection, and getting data out of a system takes both: a server at the system's end and a client wherever the data is wanted.

Two ends, two jobs

The OPC UA server owns the data. It maintains the address space, where every measurement, state and alarm is a node of its own, answers reads, sends subscription updates and, if it keeps history, serves history reads. The server waits for connections on its endpoint and never calls anyone itself.

The OPC UA client asks. It opens a session with the server, browses the node tree, reads values, subscribes to changes and, where the server allows it, writes values or calls methods. The client is the party that knows which data it needs.

OPC UA server and client side by side
OPC UA serverOPC UA client
RoleOffers data, alarms, history and methodsUses them: browses, reads, subscribes
Who opens the connectionWaits for clients on its endpointConnects to the server's endpoint
Typical examplesA PLC (e.g. Siemens S7-1500), a SCADA or DCS (e.g. WinCC, PCS 7, Valmet DNA, ABB 800xA), a gateway (e.g. KEPServerEX)Reporting and historian software, MES, analytics, another SCADA, test tools such as UaExpert

One product can be both

The role belongs to the connection, not to the product. A SCADA system is often a client towards its PLCs and a server towards the systems above it. A gateway is a client or driver on one side and a server on the other. That is why "do we have OPC UA?" is worth sharpening into: does the system have an OPC UA server that offers the measurements and alarms we need, and is it licensed and switched on?

In many systems the OPC UA server is a licensed option, or it is installed but switched off. Checking with the automation supplier saves weeks.

How do client and server come to trust each other?

OPC UA security is built on application certificates. Each end has its own X.509 certificate, and an encrypted session opens only when each trusts the other's. In practice the first connection attempt is often refused: the server puts the unknown client's certificate on its rejected list, and an administrator moves it to the trusted list. On top of the certificate, the server can require a user name and password.

  • Security policy: for production choose a strong policy such as Basic256Sha256 with Sign&Encrypt. The unencrypted None is for testing only.
  • User account: a dedicated account for the reading client, with rights only to the nodes it needs.
  • Firewall: one direction is opened, from the client to the server's port (often 4840). The server never connects to the client.

Subscription or polling?

A client can read a value once (Read) or subscribe to it (Subscription). With a subscription the server sends the value by itself when it changes or when the agreed time window elapses. This is the normal way to collect industrial data, because slowly changing measurements generate no needless traffic. Alarms travel as an event subscription of their own (Alarms & Conditions, Part 9), and history kept by the server is fetched with history reads (Historical Access, Part 11).

Which end do you need to turn the data into reports?

If the automation system already has an OPC UA server, you need a client. No new server has to be built and nothing has to change in the automation system: the client joins the existing interface and reads from it.

DataPortia™ is an OPC UA client only. It connects to the plant's existing servers, browses the node tree, subscribes to measurement points and alarms and reads the server's history. It writes nothing to the automation system and does not offer an OPC UA server of its own. Other systems reach the collected data through a read-only REST API.

  • One installation keeps several parallel connections open, and each connection can have a backup server.
  • DataPortia presents its own application certificate to the server, and getting it trusted on the server is the first step of commissioning.
  • Values are stored in a time-series database at a saving interval set per connection, for example once a second.

The background of the standard is covered in What is OPC UA?, and reading alarms in OPC UA Alarms & Conditions.

Checklist before the first connection

  1. Does the automation system have an OPC UA server, and is it licensed and switched on?
  2. What is the server's address (e.g. opc.tcp://server:4840) and which security policies does it offer?
  3. Are the measurements you need visible in the server's address space? In PLCs, check that the variables are accessible to OPC UA.
  4. Does the server offer alarms (Alarms & Conditions) and history, if you need them?
  5. Who accepts the client's certificate on the server, and which user account is used for reading?

With those five answered, the first connection can usually be tested the same day. Try DataPortia for 30 days in your own network: the trial includes every feature except the HA add-on and commits you to nothing.

Request a 30-day trial Get in touch