Skip to content
Documentation

Documentation

Welcome to the OpcSharp documentation. OpcSharp is a pure C# OPC UA client SDK with zero external OPC UA dependencies, implementing the OPC UA Binary Protocol from scratch.

What is OPC UA?

OPC Unified Architecture (OPC UA) is a machine-to-machine communication protocol for industrial automation. It provides a standardized way to discover, connect to, and exchange data with industrial devices and systems.

Why OpcSharp?

  • Pure C# — no dependency on the OPC UA Foundation stack or native libraries
  • Multi-target — runs on netstandard2.0, net8.0, net9.0, and net10.0
  • Layered — use the high-level client or reference individual layers
  • Secure — 12 security policies, 4 user identity types, certificate management
  • Production-ready — keepalive, auto-reconnect, token renewal, subscription transfer

Quick Start

var client = new OpcSharpClientBuilder()
    .WithEndpoint("opc.tcp://localhost:4840")
    .Build();

await client.ConnectAsync();

var results = await client.ReadAsync(new[]
{
    new ReadValueId
    {
        NodeId = new NodeId(0, 2258),
        AttributeId = AttributeIds.Value
    }
});

Console.WriteLine(results[0].Value);
await client.DisconnectAsync();