Selection guide
OPC UA server selection for a C# HMI across mixed PLCs
Short answer
Choose the server by two documented lists: the southbound driver catalog must name each controller family — CODESYS v3 platforms, Allen-Bradley EtherNet/IP, later Schneider and Siemens — and the northbound interface the C# client codes against must be OPC UA, because OPC DA alone does not serve a UA client. Then prove every controller path with a test read of one changing variable, checking value, quality and timestamp, before any screen binds.

On this page
Choose the OPC server by two lists, not by the OPC label. The southbound driver catalog must document every controller family the C# HMI will serve — Lenze CODESYS v3 and Allen-Bradley CompactLogix or ControlLogix now, Schneider CODESYS v3 and Siemens later — and the northbound interface your C# code targets must be an OPC UA endpoint, because OPC DA and OPC UA are different interfaces and a DA server does not serve a UA client. Commit to OPC UA as the single client interface for the whole project, score every candidate against a driver grid that names each family, and prove each controller-to-client path with a test read of one changing variable — value, quality, timestamp — before any screen binds to it. The grid, the proof procedure with a worked example and the phase-by-phase decision follow.
OPC UA and OPC DA are two different client interfaces #
OPC UA and OPC DA share a name and little else. DA is the classic interface built on Microsoft COM and DCOM: it runs on Windows, its remote connections are configured through DCOM security, and a DA server serves DA clients. UA is standardized as IEC 62541 and speaks its own secure binary protocol over TCP, with security policies and application certificates part of session setup. A server that offers DA does not automatically offer UA, and the reverse holds too — check the interface list, not the product family name.
Your C# client codes against one of these interfaces, so this choice sets the whole stack. Take OPC UA: one endpoint style across all controller families, certificate-based security instead of DCOM configuration on every remote machine, and an interface that carries the phase-2 families without redesign. UA is the heavier interface to build against — it needs more setup skill and resources than DA, mostly in certificates and security policy — so plan one bench session to get a client and server session working before any floor hardware is involved. That cost is paid once, not per controller.
Decision: the C# HMI is an OPC UA client. Fall back to DA only if a family you cannot avoid has no UA-capable server at all, and then reach it through a DA-to-UA gateway, treated as a second configuration and diagnostic boundary with its own failure modes.
The southbound driver list is the selection document #
Two products can both say OPC on the box and cover completely different controller families. The document that decides is the server's southbound driver list, checked family by family:
- Lenze CODESYS v3, phase 1. CODESYS v3 is the programming environment, not the communication interface. Establish which service the controller actually exposes. If the Lenze offers Modbus TCP, the server's Modbus TCP driver with an agreed register mapping is a sound path; if not, the vendor's native interface needs its own documented driver.
- Allen-Bradley CompactLogix and ControlLogix, phase 1. The driver must name the exact family and its tag access, not just EtherNet/IP. A protocol name on a feature grid proves as little as an imported EDS file does for cyclic I/O — the same gap set out in why an imported EDS file does not prove EtherNet/IP cyclic I/O. Only a test read settles it.
- Schneider CODESYS v3, phase 2. A separate driver decision from the Lenze one; both program in CODESYS v3 and neither inherits the other's path.
- Siemens, phase 2. The driver names the exact family, and the controller's access permissions must allow the server to read and write the variables you need.
A driver page that stops at the family name has not confirmed your hardware. The supported model and firmware list lives in the driver's own documentation; where a vendor does not publish it, their support team supplies it on request. Score candidates the way SCADA software selection for mixed PLCs and SQL logging scores packages: every family in the plan documented, or the missing family becomes its own project.
Any controller reached through Modbus TCP adds a mapping agreement: data width, signedness, register ordering and the addressing convention (0-based versus 1-based) must match between driver and controller, read from both sides' documentation before the first read. Never chase an apparent offset by trial and error on live hardware.
The selection grid #
Score each candidate server against this grid before you commit to it. A row without documentation is a failed row: the family it covers does not get assumed, it gets decided.
| Project line | The vendor documentation must show | Pass criterion |
|---|---|---|
| Lenze CODESYS v3, phase 1 | A documented driver for the exposed service — Modbus TCP with mapping, or the native interface | Test read of a changing variable returns value, quality and timestamp |
| Allen-Bradley CompactLogix / ControlLogix, phase 1 | A driver naming the exact family and its tag access | Test read of a changing controller tag through the server |
| Schneider CODESYS v3, phase 2 | Its own documented driver, separate from the Lenze one | The same test read, run at the phase-2 gate |
| Siemens, phase 2 | A driver naming the exact family; controller access permissions configured | The same test read, run at the phase-2 gate |
| Northbound interface | An OPC UA endpoint published for every driver selected above | The C# UA client holds a session and receives live subscription updates on the same node |
| Server host | A Windows machine that restarts every driver connection unattended | A bench power-cycle with no login, all connections re-established |
One server covering all six rows is the clean outcome. A server that misses a phase-2 row can still win phase 1, provided the missing family gets an explicit decision at its gate: second server, direct protocol in the application, or a different controller path.
Prove every path with a changing variable #
Prove one controller at a time, with the server's own diagnostic client or a standalone OPC test client, before the C# application touches the path.
- Configure the connection from that controller's documentation: exact device identity, network address, communication settings.
- Pick one variable that changes on its own — a cycle counter is ideal — and record its symbol or address, its data type and how fast it changes.
- Read it through the test client and record four things: value, quality or status, source timestamp, and the driver's own diagnostics.
- If the read fails, work the driver-to-controller path: network reachability, the service on the controller, access permissions, the register or tag mapping.
- If the read succeeds, connect the C# UA client to the same node and confirm it sees the same changes before any screen control binds.
Worked example — the Allen-Bradley path, with the controller at 192.168.1.10 (example address). The test variable is a controller-scoped DINT cycle counter that increments once per 500 ms machine cycle. First read: value 1047, quality GOOD, source timestamp advancing. Second read 5 seconds later: value 1057. Check the arithmetic: 1057 - 1047 = 10 increments in 5 s, which is 2 increments per second — exactly what one increment per 500 ms predicts. The value moves at the expected rate, the quality is GOOD, the timestamp tracks each change: the driver-to-controller path is proven. Point the C# client at the same node and confirm its subscription delivers the same 2 increments per second before binding the screen.
If the test client reads and the C# application does not, the fault is upstream: endpoint URL, security policy, certificate trust on both sides, node identification, subscription handling. On CODESYS v3 platforms, subscription behavior is worth understanding before you tune it — reading PLC values from a TwinCAT OPC UA server: read vs subscribe sets the two modes side by side.
Prove writes separately, and prove them with the machine stopped or in manual: a completed write transaction can still be gated or overwritten by the controller's own logic on the next scan, so an untested write path must never reach a machine that can move.
Read the fault boundary from the failed read #
A failed or frozen value has a small set of possible boundaries, and the test-read discipline tells you which one you are in:
| Observed result | Fault boundary | Next check |
|---|---|---|
| Test client cannot read the variable | Driver, controller or variable mapping | Driver diagnostics; confirm the variable independently in the controller's programming tool |
| Test client reads; the C# tag does not | Client connection or node selection | Endpoint URL, security policy, certificate trust, node identifier |
| C# tag changes; the screen does not | Control binding or UI update | Bound property, value conversion, callbacks marshaled to the UI thread |
| Read works; the write is rejected | Access rights or type conversion | Write result code, variable access rights, data type match |
| Tag reads, then holds one value | Connection lost, stale value displayed | Compare the server-side connection state with the client's subscription state |
Keep communication status separate from the process value in the application: a retained last value looks correct after the connection dies, so the screen must show the stale or invalid state as its own condition. In a C# desktop application, marshal communication callbacks onto the UI thread before touching any control — a cross-thread update failure mimics a communication fault and sends the diagnosis in the wrong direction.
Where the server host lives #
The server is a Windows application that holds every driver connection, subscription and certificate the HMI depends on. It runs unattended, so the host is infrastructure: a machine mounted in or beside the cabinet, expected to come back by itself after a power cut. That duty profile is what an industrial mini PC is built for — not an office desktop drafted into 24/7 service. Bench-test the host before installation: cut power, restore it, and confirm the server restarts without a login, re-establishes every driver connection and reloads its certificates.
The decision, phase by phase #
The architecture for this project, committed: one OPC UA server as the single northbound interface for the C# HMI, selected strictly on the grid, with every controller path proven by a changing-variable test read before screens bind.
- Northbound: OPC UA for the C# client. DA enters only if a required family has no UA-capable server at all, and then behind a gateway you diagnose as its own boundary.
- Phase 1: Lenze CODESYS v3 takes the documented path the driver list shows — Modbus TCP with an agreed register mapping, or the native driver — and Allen-Bradley CompactLogix and ControlLogix take a driver that names the family. Both pass the bench test read before floor work.
- Phase 2: Schneider CODESYS v3 and Siemens face the identical grid at the phase gate. If no server under consideration documents them by then, decide explicitly: a second server behind the same UA client interface, or that protocol implemented inside the C# application. Either is workable; an assumption is not.
- Application: keep server node addresses behind your own application tag names so no screen depends on a PLC address format, and give the finished C# application the same gate any PC-based HMI passes before it takes duty — how to prove a PC-based HMI before replacing panel terminals is that gate, applied to a client you wrote yourself.
Run the grid, run the reads, and the server choice stops being an opinion.
Questions asked
Which authentication can the OPC UA server require from the C# client?
Documented UA security policies commonly offer anonymous access, username and password, and an X.509 application certificate, optionally issued by a trusted certificate authority. Before any data moves, the client and server exchange application certificates and each must trust the other's, so the C# side needs certificate storage and handling even when the variables themselves are read anonymously. Keep anonymous access to a network segment nothing in the office can reach.
Why does a write report success but the machine keeps its old value?
A completed write proves only that the server delivered the value and the controller accepted it into the variable. The controller program can clamp it, gate it behind an interlock or overwrite it on the next scan. Read the variable back through the same path after the write, then trace in the controller program what consumes it. Commission every write path with the machine stopped or in manual.
Should the C# HMI skip OPC and speak each PLC protocol directly?
Direct drivers work for one or two families, and several HMI libraries already ship Allen-Bradley drivers. But every added family becomes new protocol code inside the application: new libraries, new threading, new diagnostics, and a full retest whenever a controller firmware revision changes. The OPC server moves that cost behind one stable interface, which is exactly what a four-family, phased project needs.
Is one server for all four families mandatory?
No. One server is the clean outcome when its driver documentation names every family. If no single catalog covers them, two servers behind the same OPC UA client interface also work: the C# application then holds two sessions, which costs one more endpoint, one more certificate set and one more diagnostic boundary, but the screen architecture and the tag layer stay single. What fails is assuming a driver exists without checking the list.


