Opc.UaFx.Advanced
2.8.3.1
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 user defined Types.
Features:
• DA: Data Access
• HDA: Historical Data Access
• AE: Alarm & 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
Optimized for:
• SIMATIC S7-1500 / S7-1200
• SIMOTION
• SINUMERIC
• all OPC UA Servers from Siemens and other providers
See the version list below for details.
Install-Package Opc.UaFx.Advanced -Version 2.8.3.1
dotnet add package Opc.UaFx.Advanced --version 2.8.3.1
<PackageReference Include="Opc.UaFx.Advanced" Version="2.8.3.1" />
paket add Opc.UaFx.Advanced --version 2.8.3.1
#r "nuget: Opc.UaFx.Advanced, 2.8.3.1"
// Install Opc.UaFx.Advanced as a Cake Addin #addin nuget:?package=Opc.UaFx.Advanced&version=2.8.3.1 // Install Opc.UaFx.Advanced as a Cake Tool #tool nuget:?package=Opc.UaFx.Advanced&version=2.8.3.1
Getting Started
The whole client development guides can be found here:
The whole server development guides can be found here:
A snippet to dig into your server:
using Opc.UaFx.Server;
...
var machineNode = new OpcObjectNode("Machine");
var messageNode = new OpcDataVariableNode<string>("Message","Hello World!");
using (var server = new OpcServer(
"opc.tcp://localhost:4840/", machineNode, messageNode)) {
server.Start();
Console.ReadLine();
// Your further code to interact with the clients.
}
A snippet to dig into your client:
using Opc.UaFx.Client;
...
using (var client = new OpcClient("opc.tcp://localhost:4840/")) {
client.Connect();
Console.WriteLine(client.ReadNode("ns=2;s=Message"));
// Your further code to interact with the server.
}
Let's Define a Node + Read the Node
// ----- Server -----
OpcDataVariableNode<bool> isRunningNode = new OpcDataVariableNode<bool>(
machineNode,
"IsRunning",
value: true);
// ----- Client -----
OpcValue isRunning = client.ReadNode("ns=2;s=Machine/IsRunning");
More: Node Management
More: Read Values of Node(s)
Let's Define a Node Tree + Write some Nodes
// ----- Server -----
OpcObjectNode jobNode = new OpcObjectNode(
machineNode,
"Job",
new OpcDataVariableNode<bool>("Cancel", false),
new OpcDataVariableNode<int>("State", -1));
// ----- Client -----
OpcStatusCollection results = client.WriteNodes(
new OpcWriteNode("ns=2;s=Machine/Job/Cancel", true),
new OpcWriteNode("ns=2;s=Machine/Job/State", 0));
More: Node Management
More: Write Values of Node(s)
Let's Define + Read a File Node
// ----- Server -----
System.IO.File.WriteAllText("Report.txt", "This is my report.");
OpcFileNode reportNode = new OpcFileNode(machineNode, "Report", "Report.txt");
// ----- Client -----
// 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: Providing File Nodes
More: Working with File Nodes
Report and Observe some Alarm's and Event's
// ----- Client -----
client.SubscribeEvent(OpcObjectTypes.Server, HandleGlobalEvents);
...
private static void HandleGlobalEvents(object sender, OpcEventReceivedEventArgs e)
{
Console.WriteLine(e.Event.Message);
}
// ----- Server -----
server.ReportEvent(OpcEventSeverity.Low, "Finished JOB-4711");
More: Providing Events
More: Working with Events
Report and Observe only Alarm's and Event's from interest
// ----- Server -----
OpcAlarmConditionNode temperatureAlarmNode = new OpcAlarmConditionNode(
machineNode,
"Temperature");
temperatureAlarmNode.Severity = OpcEventSeverity.High;
temperatureAlarmNode.Message = "Overheating use cases!";
// ----- Client -----
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);
// ----- Server -----
server.ReportEvent(temperatureAlarmNode);
More: Providing Event Nodes
More: Working with Events
Getting Started
The whole client development guides can be found here:
The whole server development guides can be found here:
A snippet to dig into your server:
using Opc.UaFx.Server;
...
var machineNode = new OpcObjectNode("Machine");
var messageNode = new OpcDataVariableNode<string>("Message","Hello World!");
using (var server = new OpcServer(
"opc.tcp://localhost:4840/", machineNode, messageNode)) {
server.Start();
Console.ReadLine();
// Your further code to interact with the clients.
}
A snippet to dig into your client:
using Opc.UaFx.Client;
...
using (var client = new OpcClient("opc.tcp://localhost:4840/")) {
client.Connect();
Console.WriteLine(client.ReadNode("ns=2;s=Message"));
// Your further code to interact with the server.
}
Let's Define a Node + Read the Node
// ----- Server -----
OpcDataVariableNode<bool> isRunningNode = new OpcDataVariableNode<bool>(
machineNode,
"IsRunning",
value: true);
// ----- Client -----
OpcValue isRunning = client.ReadNode("ns=2;s=Machine/IsRunning");
More: Node Management
More: Read Values of Node(s)
Let's Define a Node Tree + Write some Nodes
// ----- Server -----
OpcObjectNode jobNode = new OpcObjectNode(
machineNode,
"Job",
new OpcDataVariableNode<bool>("Cancel", false),
new OpcDataVariableNode<int>("State", -1));
// ----- Client -----
OpcStatusCollection results = client.WriteNodes(
new OpcWriteNode("ns=2;s=Machine/Job/Cancel", true),
new OpcWriteNode("ns=2;s=Machine/Job/State", 0));
More: Node Management
More: Write Values of Node(s)
Let's Define + Read a File Node
// ----- Server -----
System.IO.File.WriteAllText("Report.txt", "This is my report.");
OpcFileNode reportNode = new OpcFileNode(machineNode, "Report", "Report.txt");
// ----- Client -----
// 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: Providing File Nodes
More: Working with File Nodes
Report and Observe some Alarm's and Event's
// ----- Client -----
client.SubscribeEvent(OpcObjectTypes.Server, HandleGlobalEvents);
...
private static void HandleGlobalEvents(object sender, OpcEventReceivedEventArgs e)
{
Console.WriteLine(e.Event.Message);
}
// ----- Server -----
server.ReportEvent(OpcEventSeverity.Low, "Finished JOB-4711");
More: Providing Events
More: Working with Events
Report and Observe only Alarm's and Event's from interest
// ----- Server -----
OpcAlarmConditionNode temperatureAlarmNode = new OpcAlarmConditionNode(
machineNode,
"Temperature");
temperatureAlarmNode.Severity = OpcEventSeverity.High;
temperatureAlarmNode.Message = "Overheating use cases!";
// ----- Client -----
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);
// ----- Server -----
server.ReportEvent(temperatureAlarmNode);
More: Providing Event Nodes
More: Working with Events
Release Notes
https://docs.traeger.de/en/software/sdk/opc-ua/net/version.history
Dependencies
-
.NETFramework 4.6
- Microsoft.AspNetCore.Server.Kestrel (>= 1.1.3)
- Microsoft.AspNetCore.Server.Kestrel.Https (>= 1.1.3)
- Newtonsoft.Json (>= 10.0.3)
- Portable.BouncyCastle (>= 1.8.1.3)
- System.Data.Common (>= 4.3.0)
- System.ServiceModel.Primitives (>= 4.5.3)
- System.ValueTuple (>= 4.5.0)
-
.NETStandard 2.0
- Microsoft.AspNetCore.Server.Kestrel (>= 2.0.1)
- Microsoft.AspNetCore.Server.Kestrel.Https (>= 2.0.1)
- Newtonsoft.Json (>= 10.0.3)
- Portable.BouncyCastle (>= 1.8.1.3)
- System.Data.Common (>= 4.3.0)
- System.Diagnostics.Process (>= 4.3.0)
- System.ServiceModel.Primitives (>= 4.5.3)
- System.ValueTuple (>= 4.5.0)
- System.Xml.XmlDocument (>= 4.3.0)
- System.Xml.XmlSerializer (>= 4.3.0)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
2.15.0 | 185 | 4/1/2021 |
2.14.0 | 365 | 3/4/2021 |
2.13.0 | 210 | 3/1/2021 |
2.12.3 | 793 | 2/17/2021 |
2.12.2 | 105 | 2/15/2021 |
2.12.1 | 112 | 2/11/2021 |
2.12.0 | 1,042 | 2/4/2021 |
2.11.5 | 528 | 12/21/2020 |
2.11.4 | 315 | 12/15/2020 |
2.11.3.1 | 837 | 11/27/2020 |
2.11.3 | 1,679 | 11/23/2020 |
2.11.2 | 390 | 11/10/2020 |
2.11.1 | 409 | 11/5/2020 |
2.11.0 | 3,891 | 10/6/2020 |
2.10.0.3 | 553 | 9/11/2020 |
2.10.0.2 | 151 | 9/9/2020 |
2.10.0.1 | 3,081 | 7/15/2020 |
2.10.0 | 177 | 7/14/2020 |
2.9.2.1 | 2,919 | 5/8/2020 |
2.9.2 | 173 | 5/6/2020 |
2.9.1 | 334 | 4/22/2020 |
2.9.0 | 654 | 4/1/2020 |
2.8.3.1 | 2,515 | 1/24/2020 |
2.8.3 | 352 | 1/16/2020 |
2.8.2.1 | 558 | 12/13/2019 |
2.8.2 | 641 | 11/6/2019 |
2.8.1.3 | 266 | 10/24/2019 |
2.8.1.2 | 1,810 | 10/23/2019 |
2.8.1.1 | 396 | 10/11/2019 |
2.8.1 | 274 | 9/25/2019 |
2.8.0 | 265 | 9/18/2019 |
2.7.5.1 | 426 | 8/15/2019 |
2.7.5 | 285 | 8/13/2019 |
2.7.4 | 540 | 6/7/2019 |
2.7.3.1 | 326 | 5/23/2019 |
2.7.3 | 328 | 5/17/2019 |
2.7.2 | 321 | 5/10/2019 |
2.7.1.1 | 315 | 4/29/2019 |
2.7.1 | 487 | 3/25/2019 |
2.7.0.2 | 341 | 3/18/2019 |
2.7.0.1 | 301 | 3/15/2019 |
2.7.0 | 283 | 3/14/2019 |
2.6.0 | 599 | 2/20/2019 |
2.5.7 | 413 | 2/6/2019 |
2.5.4 | 1,349 | 8/27/2018 |
2.5.3 | 539 | 8/21/2018 |
2.5.2.5 | 551 | 8/7/2018 |
2.5.2.3 | 578 | 7/25/2018 |
2.5.2.2 | 515 | 7/24/2018 |
2.2.1 | 1,532 | 9/7/2017 |
1.5.11.5 | 2,089 | 6/14/2016 |
1.5.11.3 | 846 | 5/2/2016 |
1.5.11.2 | 884 | 4/29/2016 |
1.5.10 | 872 | 2/9/2016 |
1.5.6.1 | 1,164 | 9/8/2015 |