Course B4 · Build

Write a client and a server

The same twelve tasks, implemented four times: Python with asyncua, Node with node-opcua, C# with the OPC Foundation reference stack, and C with open62541. Learning the shape once means you can read any OPC UA SDK afterwards.

Lessons10
Timeabout 80 minutes
PrerequisitesA4, and one of Python, JavaScript, C# or C
CostFree: written lessons open, video and labs need a free account

What you will be able to do

  • You can write a working client in at least one of four languages.
  • You can write a minimal server that exposes a typed variable and a method.
  • You can map an unfamiliar SDK onto the twelve tasks you already know.
  • You can choose a stack for a project and defend the choice on real constraints.

Syllabus

  1. 1
    Choose a stack on real constraints

    Licence, language, embedded target, PubSub support, certifiability and who supports it commercially. Not on which one has the nicest README.

    Asset A comparison table of the four stacks with pinned versions, licences and real limitations

    8 min
  2. 2
    Connect and browse in four languages

    The same operation four times, so the pattern separates from the syntax.

    Asset Four runnable programs producing the same browse output against the same server

    9 min
  3. 3
    Read and write in four languages

    Where each SDK puts typing, and how each surfaces a status code.

    Asset Four programs writing the same value, with each SDK's error on a deliberate type mismatch

    8 min
  4. 4
    Subscribe in four languages

    Callback shapes, async models, and where each SDK exposes the parameters that matter.

    Asset Four subscription programs with their delivered output side by side

    9 min
  5. 5
    Handle certificates in four languages

    Each stack's PKI directory conventions and helper APIs: the part of every SDK that is documented worst.

    Asset The PKI setup code and folder layout for each of the four stacks

    8 min
  6. 6
    Reconnect properly

    Backoff, subscription transfer, and the state a client must keep to recover without losing data.

    Asset A client surviving three server restarts, with its reconnect log

    8 min
  7. 7
    Write a minimal server

    Expose one typed variable, one method and one event. Enough to test a client against.

    Asset A working minimal server in each of the four stacks, with a client reading from it

    9 min
  8. 8
    Add a type to your server

    Registering an ObjectType and instantiating it, so your server is browsable rather than flat.

    Asset A server exposing a custom type with two instances, browsed in UaExpert

    8 min
  9. 9
    Instrument and log usefully

    What to log at each layer so that a support ticket contains the answer. Most OPC UA logs are useless.

    Asset A log format with real lines from a failed and a successful connection

    7 min
  10. 10
    Test without a PLC

    Simulation servers, containers, and how to build a repeatable test rig for OPC UA code in CI.

    Asset A docker-compose rig with a simulated server and a test suite that runs against it

    6 min

Lab

Free account required

Implement the same subscription in two of the four languages, point both at the same server, and confirm they deliver identical values with identical timestamps.

Unlock the lab →
Specification background

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login