PLCcom.Opc.Ua.PubSub 10.6.2

dotnet add package PLCcom.Opc.Ua.PubSub --version 10.6.2
                    
NuGet\Install-Package PLCcom.Opc.Ua.PubSub -Version 10.6.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PLCcom.Opc.Ua.PubSub" Version="10.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PLCcom.Opc.Ua.PubSub" Version="10.6.2" />
                    
Directory.Packages.props
<PackageReference Include="PLCcom.Opc.Ua.PubSub" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PLCcom.Opc.Ua.PubSub --version 10.6.2
                    
#r "nuget: PLCcom.Opc.Ua.PubSub, 10.6.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PLCcom.Opc.Ua.PubSub@10.6.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PLCcom.Opc.Ua.PubSub&version=10.6.2
                    
Install as a Cake Addin
#tool nuget:?package=PLCcom.Opc.Ua.PubSub&version=10.6.2
                    
Install as a Cake Tool

PLCcom.Opc.Ua.PubSub

An add-on for building OPC UA PubSub publisher and subscriber applications. It runs cross-platform on .NET Framework 4.7.2+, .NET Standard 2.1, .NET 8, .NET 9, and .NET 10.

Requires PLCcom.Opc.Ua.Sdk with a Client + PubSub or Client + Server + PubSub license.


What PLCcom.Opc.Ua.PubSub has to offer

PLCcom.Opc.Ua.PubSub implements the OPC UA PubSub specification (Part 14) with a simple, fluent API. Publishers and subscribers are configured with a builder pattern and started with a single call — no low-level stack configuration required.

Supported transports:

  • UDP unicast (brokerless, point-to-point)
  • UDP multicast (brokerless, one-to-many)
  • MQTT with UADP binary encoding (broker-based)
  • MQTT with JSON encoding (broker-based, cloud-ready)
  • sMQTT (MQTT over TLS) for all broker-based transports

Key features:

  • Fluent builder API — configure publisher or subscriber in a few lines
  • Automatic metadata exchange — subscribers discover field layouts dynamically
  • PKI-based TLS certificate management — same model as PLCcom.Opc.Ua.Sdk
  • CertificateValidation event — same pattern as UaClient
  • Mutual TLS (mTLS) support for broker authentication
  • Configurable reconnect interval for MQTT connections

Getting started

1. Install the NuGet package

Install-Package PLCcom.Opc.Ua.PubSub

2. Import namespaces

using PLCcom.Opc.Ua;
using PLCcom.Opc.Ua.PubSub.Sdk;

Publisher

UDP Unicast (brokerless)

string LicenseUserName = "<Enter your UserName here>";
string LicenseSerial   = "<Enter your Serial here>";

var config = UaPublisherConfiguration.Build("MyPublisher", "opcua:MyMachine")
    .WithNetworkInterface(NetworkInterfaces.All)
    .WithTransport(PubSubTransportMode.DirectUnicast, "opc.udp://192.168.1.10:4840")
    .WithPublishingInterval(1000)
    .AddDataSet("Sensors", ds => ds
        .AddField("Temperature", new NodeId(1001, 2))
        .AddField("Pressure",    new NodeId(1002, 2))
        .WithKeyFrameCount(10)
        .WithInterval(1000));

using var publisher = new UaPublisher(LicenseUserName, LicenseSerial, config);
publisher.Start();

publisher.WriteValue("Sensors", "Temperature", 23.5);
publisher.WriteValue("Sensors", "Pressure",    1.013);

MQTT with JSON encoding (broker-based)

var config = UaPublisherConfiguration.Build("MyPublisher", "opcua:MyMachine")
    .WithNetworkInterface(NetworkInterfaces.All)
    .WithTransport(PubSubTransportMode.BrokerMqttJson, "mqtt://broker.local:1883")
    .WithPublishingInterval(1000)
    .AddDataSet("Sensors", ds => ds
        .AddField("Temperature", new NodeId(1001, 2))
        .AddField("Pressure",    new NodeId(1002, 2))
        .WithKeyFrameCount(10)
        .WithInterval(1000));

using var publisher = new UaPublisher(LicenseUserName, LicenseSerial, config);
publisher.Start();

sMQTT (MQTT over TLS)

var config = UaPublisherConfiguration.Build("MyPublisher", "opcua:MyMachine")
    .WithNetworkInterface(NetworkInterfaces.All)
    .WithTransport(PubSubTransportMode.BrokerMqttUadp, "mqtts://broker.local:8883")
    .WithMqttTls("./pki")
    .WithPublishingInterval(1000)
    .AddDataSet("Sensors", ds => ds
        .AddField("Temperature", new NodeId(1001, 2))
        .WithKeyFrameCount(10)
        .WithInterval(1000));

using var publisher = new UaPublisher(LicenseUserName, LicenseSerial, config);

// Accept broker certificate (for testing - use PKI store in production)
publisher.CertificateValidation += (sender, e) => e.Accept = true;

publisher.Start();

Subscriber

UDP Multicast (brokerless)

var config = UaSubscriberConfiguration.Build("MySubscriber")
    .WithNetworkInterface(NetworkInterfaces.All)
    .WithTransport(PubSubTransportMode.DirectMulticast, "opc.udp://239.0.0.1:4840")
    .AddDataSetReader("opcua:MyMachine", "Sensors", ds => ds
        .AddField("Temperature", BuiltInType.Double)
        .AddField("Pressure",    BuiltInType.Double));

using var subscriber = new UaSubscriber(LicenseUserName, LicenseSerial, config);

subscriber.DataReceived += (sender, e) =>
{
    Console.WriteLine($"Temperature = {e.Fields["Temperature"].Value}");
    Console.WriteLine($"Pressure    = {e.Fields["Pressure"].Value}");
};

subscriber.Start();

MQTT with dynamic field discovery

For MQTT transports, the publisher publishes DataSetMetaData with the RETAIN flag. The subscriber can omit AddField() — the field layout is received automatically:

var config = UaSubscriberConfiguration.Build("MySubscriber")
    .WithNetworkInterface(NetworkInterfaces.All)
    .WithTransport(PubSubTransportMode.BrokerMqttJson, "mqtt://broker.local:1883")
    // No AddField() needed - field layout received via MQTT RETAIN metadata
    .AddDataSetReader("opcua:MyMachine", "Sensors");

sMQTT Subscriber

var config = UaSubscriberConfiguration.Build("MySubscriber")
    .WithNetworkInterface(NetworkInterfaces.All)
    .WithTransport(PubSubTransportMode.BrokerMqttUadp, "mqtts://broker.local:8883")
    .WithMqttTls("./pki")
    .AddDataSetReader("opcua:MyMachine", "Sensors", ds => ds
        .AddField("Temperature", BuiltInType.Double));

using var subscriber = new UaSubscriber(LicenseUserName, LicenseSerial, config);

subscriber.CertificateValidation += (sender, e) => e.Accept = true;

subscriber.DataReceived += (sender, e) =>
{
    foreach (var field in e.Fields)
        Console.WriteLine($"{field.Key} = {field.Value.Value}");
};

subscriber.Start();

Transport modes

Mode Description
DirectUnicast UDP unicast, UADP encoding, no broker
DirectMulticast UDP multicast, UADP encoding, no broker
BrokerMqttUadp MQTT broker, UADP binary encoding
BrokerMqttJson MQTT broker, JSON encoding (cloud-ready)

Use mqtts:// scheme with .WithMqttTls() for TLS on any broker transport.


PKI Certificate Management (TLS)

WithMqttTls(pkiBase) uses the standard OPC UA PKI directory convention:

./pki/trusted/certs/   - directly trusted broker certificates
./pki/trusted/crl/     - certificate revocation lists
./pki/issuers/certs/   - trusted CA/issuer certificates
./pki/issuers/crl/     - issuer revocation lists
./pki/rejected/        - certificates rejected on first contact

On first connection, the broker certificate is placed in rejected/. Copy the broker's CA certificate to issuers/certs/ to trust it permanently.

For mutual TLS (mTLS), load a client certificate and pass it to WithMqttTls():

var clientResult = UaPubSubCertificate.LoadOwnCertificate(
    "./pki", "mqtt_client", "password",
    UaPubSubCertificate.CertificateFormat.Pfx);

config.WithMqttTls("./pki", clientResult.Certificate);

System Requirements

Supported platforms:

  • Microsoft .NET Framework 4.7.2 or higher (up to 4.8.1)
  • Microsoft .NET 5.0 to 7.0 via .NET Standard 2.1
  • Microsoft .NET 8.0
  • Microsoft .NET 9.0
  • Microsoft .NET 10.0

Prerequisites:

  • PLCcom.Opc.Ua.Sdk NuGet package (installed automatically as dependency)
  • A valid PLCcom license with PubSub add-on (Client + PubSub or Client + Server + PubSub)

Additional Documentation

Online class reference: https://docs.plccom.net/help_opc_ua_sdk/net/help/html/R_Project_PLCcom_Opc_Ua_Sdk_Documentation.htm

Quick-start examples on GitHub: https://github.com/indi-an-gmbh/PLCcom-OpcUaSdk-examples-dotnet

Feedback

To provide feedback or report issues, please write to: support@indi-an.com

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.6.2 43 7/23/2026
10.5.6 112 6/29/2026
10.5.2 109 6/9/2026
10.5.1 114 5/26/2026