LiteUa is a native, lightweight, and dependency-free OPC UA Client Library written entirely in C# from scratch.
Unlike other libraries that wrap the official OPC Foundation .NET Stack (which imposes GPL licensing constraints) or commercial SDKs, LiteUa implements the OPC UA binary protocol directly on top of TCP. This makes it extremely fast, lean, and permissive-license friendly.
⚠️ Work In Progress (WIP)This library is currently in an early development stage. While the core functionality (Secure Connection, Read/Write, Subscriptions) is implemented and tested, it does not yet cover the entire 1000+ page OPC UA specification. Use with caution in production environments.
- Zero 3rd Party Dependencies: The core library is built directly on
System.Net.SocketsandSystem.Buffers. No dependency on the official OPC Foundation Stack. No GPL viral licensing issues. - Pure C#: Fully managed code without native wrappers.
- High Performance: Features a built-in
UaClientPoolfor request-heavy scenarios. - Resilient: Includes a
SubscriptionClientwith automatic reconnection and self-healing capabilities. - Tested: Everything is tested using integration tests against Siemens S7-1200 (modeled OPC Server interface) and S7-1500 controllers (standard Simatic OPC Server interface).
While the LiteUa core library is strictly dependency-free to ensure ease of licensing, the Test Projects utilize external packages (e.g., xUnit, Microsoft.NET.Test.Sdk) to ensure code quality and protocol correctness.
For a full list of dependencies used in the test environment, please refer to: 📄 THIRD-PARTY-PACKAGES.md
LiteUa covers the most important features required for HMI/SCADA and IoT connectivity:
- OPC UA TCP Transport: Efficient Chunking and Message handling.
- Secure Channel: Support for
SignandSignAndEncrypt. - Policies: Full implementation of
Basic256Sha256(RSA-OAEP, AES-CBC, HMAC-SHA256). - Authentication:
AnonymousandUserName(including encrypted password transmission). - Certificate Management: Handling of X.509 Certificates and Server Signature validation.
- Read / Write: Support for Scalars, Arrays, and complex Structures (UDTs).
- Browse: Recursive browsing with Bulk support and automatic Paging (ContinuationPoints).
- Method Calls: Call methods directly on the server with typed argument mapping.
- Subscriptions: Monitoring of data changes (DataChangeNotification) with KeepAlive logic.
- Type Registry: Dynamic decoding of custom structures (ExtensionObjects) without code generation.
- Connection Pool: Thread-safe pooling for high-throughput transactional operations.
- Async/Await: Fully asynchronous API design supporting
CancellationTokens.
The following features are not (yet) implemented:
- Events & Alarms (EventNotificationList).
- History Access (HDA).
- Complex Discovery Services (GDS).
- XML Encoding (only Binary is supported).
- Other Security Policies / Algorithms than Basic256Sha256.
The library is split into logical layers:
- Builtin: OPC Type definitions (
Variant,DataValue,NodeId). - Client: Client classes for data access, pooling and subscriptions.
- Encoding: Classes for binary encoding and decoding.
- Security: Everything security related (policies, certificate factory, ...).
- Stack: Implementation of the OPC UA stack / services.
- Transport: The underlying TCP connection logic.
Contributions are welcome! Since this is a "from scratch" implementation, please ensure any PRs maintain the zero-dependency philosophy for the main library.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
You are free to use, modify, and distribute this software in commercial and private applications.
Built with ❤️ and a lot of reverse engineering.