Leo.OPC
0.0.1
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Leo.OPC --version 0.0.1
NuGet\Install-Package Leo.OPC -Version 0.0.1
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="Leo.OPC" Version="0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Leo.OPC --version 0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Leo.OPC, 0.0.1"
#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 Leo.OPC as a Cake Addin
#addin nuget:?package=Leo.OPC&version=0.0.1
// Install Leo.OPC as a Cake Tool
#tool nuget:?package=Leo.OPC&version=0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
public static async Task Main(string[] args)
{
//日志的输出模板
string Logformat = @"{Timestamp:yyyy-MM-dd HH:mm-dd }[{Level:u3}] {Message:lj}{NewLine}";
//类似创建一个管道
Log.Logger = new LoggerConfiguration()
//设置最低等级
.MinimumLevel.Debug()
//将事件发送到控制台并展示
.WriteTo.Console(outputTemplate: Logformat)
.CreateLogger();
Log.Logger.Information("OPC UA Console Reference Client");
try
{
// Define the UA Client application
ApplicationInstance application = new ApplicationInstance();
application.ApplicationName = "Quickstart Console Reference Client";
application.ApplicationType = ApplicationType.Client;
// load the application configuration.
await application.LoadApplicationConfiguration("Opc.Ua.SampleClient.Config.xml", silent: false);
// check the application certificate.
await application.CheckApplicationInstanceCertificate(silent: false, minimumKeySize: 0);
// create the UA Client object and connect to configured server.
UAClient uaClient = new UAClient(application.ApplicationConfiguration, ClientBase.ValidateResponse);
uaClient.ServerUrl = "opc.tcp://127.0.0.1:49320";
bool connected = await uaClient.ConnectAsync();
if (connected)
{
// Run tests for available methods.
var r_ret = uaClient.ReadNodes(new string[] {
"ns=2;s=Channel1.Device1.Tag1",
"ns=2;s=Channel1.Device1.Tag2",
"ns=2;s=Channel1.Device1.Tag3"
}.ToList());
r_ret.ForEach(o =>
{
Log.Logger.Information(String.Format("{0}, Read Value = {1} , StatusCode = {2}", o.NodeId, o.DataValue, o.StatusCode));
});
var w_ret = uaClient.WriteNodes(new Dictionary<string, object>
{
{"ns=2;s=Channel1.Device1.Tag3", "that's good!" }
});
w_ret.ForEach(o =>
{
Log.Logger.Information(String.Format("{0}, Write Value = {1} , StatusCode = {2}", o.NodeId, o.DataValue, o.StatusCode));
});
var browseResults = uaClient.Browse(ObjectIds.ObjectsFolder);
foreach(var result in browseResults)
{
Log.Logger.Information(" DisplayName = {0}, NodeClass = {1}, NodeId = {2}", result.DisplayName.Text, result.NodeClass, result.NodeId);
if (result.NodeClass != NodeClass.Variable)
{
uaClient.Browse(ObjectIds.ObjectsFolder);
}
}
//uaClient.CallMethod();
//uaClient.SubscribeToDataChanges();
// Wait for some DataChange notifications from MonitoredItems
await Task.Delay(1_000);
uaClient.Disconnect();
}
else
{
Log.Logger.Information("Could not connect to server!");
}
Log.Logger.Information("Program ended.");
Log.Logger.Information("Press any key to finish...");
}
catch (Exception ex)
{
Log.Logger.Error(ex.Message);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.
-
.NETStandard 2.0
- OPCFoundation.NetStandard.Opc.Ua (>= 1.4.368.33)
- Serilog (>= 2.8.0)
-
.NETStandard 2.1
- OPCFoundation.NetStandard.Opc.Ua (>= 1.4.368.33)
- Serilog (>= 2.8.0)
-
net6.0
- OPCFoundation.NetStandard.Opc.Ua (>= 1.4.368.33)
- Serilog (>= 2.8.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Leo.OPC:
Package | Downloads |
---|---|
Leo.Extensions.OPC
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.