Opc.UaFx.Client 2.11.5

OPC UA Client SDK supporting OPC DA, AE and HDA for quick & easy OPC UA Client development using .NET Framework and .NET Standard. Simple & familiar .NET API, portability, features, patterns, samples and technical support. Unlimited free evaluation & royalty free licensing. Designed and implemented using Microsoft's Framework Design Guidelines by Traeger in Germany/Bavaria with over 30 years of experience in industrial communication.

NEW!
Samples available at https://github.com/Traeger-GmbH/opcuanet-samples

OPC Watch
Download: https://docs.traeger.de/en/software/sdk/opc-ua/net#download
Usage: Browse, read, write, subscribe nodes or generate code for user defined types from server or nodeset.

Features:
• DA: Data Access
• HDA: Historical Data Access
• AE: Alarms & Events + Conditions
• IO: FileAccess
• API: Methods and Enumerations
• OPC Classic Support
• Others:
 • Units of Measurements
 • Complex/Structured Data Types

Characteristics:
• Simple and fast Client Development
• Minimum number of lines of code
• Uses OPC Foundation Stack v1.03.351.0
• Significantly reduced lines of code compared to OPC Foundation Stack

Framework Features:
• Data Types using Name-Value pairs, .NET dynamic and user defined types
• Linq to Objects support to browse nodes
• Simplified automatic certificate management
• Advanced node identifier formats like compound, URI or Foundation
• Database Cursor like historical data access
• Event driven programming model for certificates and subscriptions

Tested with:
• SIMATIC S7-1500, SIMOTION, SINUMERIC, ...
• and many more other vendors

Works on:
• Windows / Ubuntu / Debian / macOS
• Android / iOS

There is a newer version of this package available.
See the version list below for details.
Install-Package Opc.UaFx.Client -Version 2.11.5
dotnet add package Opc.UaFx.Client --version 2.11.5
<PackageReference Include="Opc.UaFx.Client" Version="2.11.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Opc.UaFx.Client --version 2.11.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Opc.UaFx.Client, 2.11.5"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

Getting Started

The whole client development guides can be found here:

The most essential snippet to dig in:

using Opc.UaFx.Client;
...
using (var client = new OpcClient("opc.tcp://localhost:4840/")) {
    client.Connect();
    // Your code to interact with the server.
}

Let's Read a Node

OpcValue isRunning = client.ReadNode("ns=2;s=Machine/IsRunning");

More: Read Values of Node(s)

Let's Write a Node

OpcStatus result = client.WriteNode("ns=2;s=Machine/Job/Cancel", true);

More: Write Values of Node(s)

Let's Read a File Node

// All at once
string reportText = OpcFile.ReadAllText(client, "ns=2;s=Machine/Report");

// All via a stream
using (var stream = OpcFile.OpenRead(client, "ns=2;s=Machine/Report")) {
    var reader = new StreamReader(stream);

    while (!reader.EndOfStream)
        Console.WriteLine(reader.ReadLine());
}

More: Working with File Nodes

Browse the Node Tree

// One node
OpcNodeInfo machineNode = client.BrowseNode("ns=2;s=Machine");

// A child node
OpcNodeInfo jobNode = machineNode.Child("Job");

// Some child nodes
foreach (var childNode in machineNode.Children()) {
    // Your code to operate on each child node.
}

// Some node attributes
OpcAttributeInfo displayName = machineNode.Attribute(OpcAttribute.DisplayName);

foreach (var attribute in machineNode.Attributes()) {
    // Your code to operate on each attribute.
}

More: Browsing Nodes

Observe some Alarm's and Event's

client.SubscribeEvent(OpcObjectTypes.Server, HandleGlobalEvents);

...

private static void HandleGlobalEvents(object sender, OpcEventReceivedEventArgs e)
{
    Console.WriteLine(e.Event.Message);
}

More: Working with Events

Observe only Alarm's and Event's from interest

var severity = new OpcSimpleAttributeOperand(OpcEventTypes.Event, "Severity");
var conditionName = new OpcSimpleAttributeOperand(OpcEventTypes.Condition, "ConditionName");

var filter = OpcFilter.Using(client)
        .FromEvents(OpcEventTypes.AlarmCondition)
        .Where(severity > OpcEventSeverity.Medium & conditionName.Like("Temperature"))
        .Select();

client.SubscribeEvent(OpcObjectTypes.Server, filter, HandleGlobalEvents);

More: Working with Events

Getting Started

The whole client development guides can be found here:

The most essential snippet to dig in:

using Opc.UaFx.Client;
...
using (var client = new OpcClient("opc.tcp://localhost:4840/")) {
    client.Connect();
    // Your code to interact with the server.
}

Let's Read a Node

OpcValue isRunning = client.ReadNode("ns=2;s=Machine/IsRunning");

More: Read Values of Node(s)

Let's Write a Node

OpcStatus result = client.WriteNode("ns=2;s=Machine/Job/Cancel", true);

More: Write Values of Node(s)

Let's Read a File Node

// All at once
string reportText = OpcFile.ReadAllText(client, "ns=2;s=Machine/Report");

// All via a stream
using (var stream = OpcFile.OpenRead(client, "ns=2;s=Machine/Report")) {
    var reader = new StreamReader(stream);

    while (!reader.EndOfStream)
        Console.WriteLine(reader.ReadLine());
}

More: Working with File Nodes

Browse the Node Tree

// One node
OpcNodeInfo machineNode = client.BrowseNode("ns=2;s=Machine");

// A child node
OpcNodeInfo jobNode = machineNode.Child("Job");

// Some child nodes
foreach (var childNode in machineNode.Children()) {
    // Your code to operate on each child node.
}

// Some node attributes
OpcAttributeInfo displayName = machineNode.Attribute(OpcAttribute.DisplayName);

foreach (var attribute in machineNode.Attributes()) {
    // Your code to operate on each attribute.
}

More: Browsing Nodes

Observe some Alarm's and Event's

client.SubscribeEvent(OpcObjectTypes.Server, HandleGlobalEvents);

...

private static void HandleGlobalEvents(object sender, OpcEventReceivedEventArgs e)
{
    Console.WriteLine(e.Event.Message);
}

More: Working with Events

Observe only Alarm's and Event's from interest

var severity = new OpcSimpleAttributeOperand(OpcEventTypes.Event, "Severity");
var conditionName = new OpcSimpleAttributeOperand(OpcEventTypes.Condition, "ConditionName");

var filter = OpcFilter.Using(client)
        .FromEvents(OpcEventTypes.AlarmCondition)
        .Where(severity > OpcEventSeverity.Medium & conditionName.Like("Temperature"))
        .Select();

client.SubscribeEvent(OpcObjectTypes.Server, filter, HandleGlobalEvents);

More: Working with Events

Release Notes

https://docs.traeger.de/en/software/sdk/opc-ua/net/version.history

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Opc.UaFx.Client:

Package Downloads
Crosser.EdgeNode.Modules.Opc
Package Description
OPCUA.Library
OPC UA library supporting OPC UA Client development for Xserver.IoT device.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.13.0 53 3/1/2021
2.12.3 131 2/17/2021
2.12.2 132 2/15/2021
2.12.1 64 2/11/2021
2.12.0 183 2/4/2021
2.11.5 425 12/21/2020
2.11.4 118 12/15/2020
2.11.3.1 487 11/27/2020
2.11.3 217 11/23/2020
2.11.2 222 11/10/2020
2.11.1 177 11/5/2020
2.11.0 2,024 10/6/2020
2.10.0.3 746 9/11/2020
2.10.0.2 126 9/9/2020
2.10.0.1 508 7/15/2020
2.10.0 687 7/14/2020
2.9.2.1 2,838 5/8/2020
2.9.2 199 5/6/2020
2.9.1 244 4/22/2020
2.9.0 675 4/1/2020
2.8.3.1 4,451 1/24/2020
2.8.3 887 1/16/2020
2.8.2.1 560 12/13/2019
2.8.2 569 11/6/2019
2.8.1.3 420 10/24/2019
2.8.1.2 181 10/23/2019
2.8.1.1 289 10/11/2019
2.8.1 270 9/25/2019
2.8.0 221 9/18/2019
2.7.5.1 306 8/15/2019
2.7.5 222 8/13/2019
2.7.4 1,391 6/7/2019
2.7.3.1 266 5/23/2019
2.7.3 268 5/17/2019
2.7.2 258 5/10/2019
2.7.1.1 262 4/29/2019
2.7.1 554 3/25/2019
2.7.0 277 3/14/2019
2.6.0 475 2/20/2019
2.5.7 319 2/6/2019
2.5.6 2,882 10/19/2018
2.5.5 431 10/11/2018
Show less