OPCUaClient 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OPCUaClient --version 1.1.0
NuGet\Install-Package OPCUaClient -Version 1.1.0
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="OPCUaClient" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OPCUaClient --version 1.1.0
#r "nuget: OPCUaClient, 1.1.0"
#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.
// Install OPCUaClient as a Cake Addin
#addin nuget:?package=OPCUaClient&version=1.1.0

// Install OPCUaClient as a Cake Tool
#tool nuget:?package=OPCUaClient&version=1.1.0

OPCUaClient

Client for OPC UA Server

How to use

Import

 using OPCUaClient;

Make a instance

 UaClient client = new UaClient("test", "opc.tcp://localhost:52240", true, true);

Create a session on the server

 int seconds = 30;
 client.Connect(seconds);

Close session

 client.Disconnect();

Read a tag

 Tag tag = client.Read("Device.Counter.OK");
 Console.WriteLine($"Name: {tag.Name}");
 Console.WriteLine($"Address: {tag.Address}");
 Console.WriteLine($"Value: {tag.Value}");
 Console.WriteLine($"Quality: {tag.Quality}");

Read multiple tags

var address = new List<String>
{
  "Device.Counter.OK",
  "Device.Counter.NG",
  "Device.Counter.Model",
  "Device.Counter.CycleTime"
}
 var tags = client.Read(address);
 
 foreach(var tag in tags)
 {
    Console.WriteLine($"Name: {tag.Name}");
    Console.WriteLine($"Address: {tag.Address}");
    Console.WriteLine($"Value: {tag.Value}");
    Console.WriteLine($"Quality: {tag.Quality}");
 }

Write a tag


 client.Write("Device.Counter.Model", "NewModel");

Write multiple tags

var tags = new List<Tag>
{
  new Tag {
    Address = "Device.Counter.OK",
    Value = 0,
  },
  new Tag {
    Address = "Device.Counter.NG",
    Value = 0,
  },
  new Tag {
    Address = "Device.Counter.Model",
    Value = "OtherModel",
  },
  new Tag {
    Address = "Device.Counter.CycleTime",
    Value = 10,
  },
}
 client.Write(tags);

Monitoring a tag


 client.Monitoring("Device.Counter.OK", 500, (_, e) => {
   // Anything you need to be executed when the value changes
 
   // Get the value of the tag being monitored
    var monitored = (MonitoredItemNotification)e.NotificationValue;
    Console.WriteLine(monitored.Value);

});

License

MIT

Icon for Freepik

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on OPCUaClient:

Package Downloads
OPCUACoreClass.Net6.OPCLib

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.13.0 2,728 7/9/2023
1.10.0 1,588 2/20/2023
1.9.0 1,396 11/13/2022
1.8.0 623 11/10/2022
1.7.0 736 10/23/2022
1.6.0 838 9/14/2022
1.5.0 818 9/14/2022
1.4.0 752 9/13/2022
1.1.0 773 9/12/2022
1.0.0 786 9/11/2022

Error when writing in the tags fixed.
Added tag monitoring function.