Atc.Opc.Ua 1.0.71

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

// Install Atc.Opc.Ua as a Cake Tool
#tool nuget:?package=Atc.Opc.Ua&version=1.0.71                

NuGet Version

Atc.Opc.Ua

OPC UA industrial library for executing commands, reads and writes on OPC UA servers

Table of Contents

OpcUaClient

After installing the latest nuget package, the OpcUaClient can be wired up as follows:

services.AddTransient<IOpcUaClient, OpcUaClient>(s =>
{
    var loggerFactory = s.GetRequiredService<ILoggerFactory>();
    return new OpcUaClient(loggerFactory.CreateLogger<OpcUaClient>());
});

Configuring OPC UA Security Settings

By default, the OpcUaClient will create its own self-signed certificate to present to external OPC UA Servers. However, if you have your own certificate to utilize, the service can be configured using the available OpcUaSecurityOptions. This class facilitates the configuration of certificate stores, the application certificate, and other essential security settings for secure communication.

These settings can be wired up from an appsettings.json file or manually constructed in code. Another constructor overload in OpcUaClient is available for injecting an instance of IOptions<SecurityOptions>.

An example of this configuration in appsettings.json could look like the following.

Note: The example values below will be the default values, if they are not provided. Except subjectName, which will be something like 'OpcUaClient [RANDOM_SERIAL_NUMBER]' for the self-signed certificate generated.

{
  "OpcUaSecurityOptions": {
    "PkiRootPath": "opc/pki",
    "ApplicationCertificate": {
      "StoreType": "Directory",
      "StorePath": "own",
      "SubjectName": "CN=YourApp"
    },
    "RejectedCertificates": {
      "StoreType": "Directory",
      "StorePath": "rejected"
    },
    "TrustedIssuerCertificates": {
      "StoreType": "Directory",
      "StorePath": "issuers"
    },
    "TrustedPeerCertificates": {
      "StoreType": "Directory",
      "StorePath": "trusted"
    },
    "AddAppCertToTrustedStore": true,
    "AutoAcceptUntrustedCertificates": false,
    "MinimumCertificateKeySize": 1024,
    "RejectSha1SignedCertificates": true,
    "RejectUnknownRevocationStatus": true
  }
}

and from your C# code:

services
    .AddOptions<OpcUaSecurityOptions>()
    .Bind(configuration.GetRequiredSection(nameof(OpcUaSecurityOptions)))
    .ValidateDataAnnotations()
    .ValidateOnStart();

services.AddTransient<IOpcUaClient, OpcUaClient>();

CLI Tool

The Atc.Opc.Ua.CLI tool is available through a cross platform command line application.

Requirements

Installation

The tool can be installed as a .NET global tool by the following command

dotnet tool install --global atc-opc-ua

or by following the instructions here to install a specific version of the tool.

A successful installation will output something like

The tool can be invoked by the following command: atc-opc-ua
Tool 'atc-opc-ua' (version '1.0.xxx') was successfully installed.`

Update

The tool can be updated by the following command

dotnet tool update --global atc-opc-ua

Usage

Since the tool is published as a .NET Tool, it can be launched from anywhere using any shell or command-line interface by calling atc-opc-ua. The help information is displayed when providing the --help argument to atc-opc-ua

Option <span style="color:yellow">--help</span>

atc-opc-ua --help


USAGE:
    atc-opc-ua.exe [OPTIONS] <COMMAND>

EXAMPLES:
    atc-opc-ua.exe testconnection -s opc.tcp://opcuaserver.com:48010
    atc-opc-ua.exe testconnection -s opc.tcp://opcuaserver.com:48010 -u username -p password
    atc-opc-ua.exe node read object -s opc.tcp://opcuaserver.com:48010 -n "ns=2;s=Demo.Dynamic.Scalar"
    atc-opc-ua.exe node read variable single -s opc.tcp://opcuaserver.com:48010 -n "ns=2;s=Demo.Dynamic.Scalar.Float"
    atc-opc-ua.exe node read variable multi -s opc.tcp://opcuaserver.com:48010 -n "ns=2;s=Demo.Dynamic.Scalar.Float" -n "ns=2;s=Demo.Dynamic.Scalar.Int32"

OPTIONS:
    -h, --help       Prints help information
    -v, --version    Prints version information

COMMANDS:
    testconnection    Tests if a connection can be made to a given server
    node              Operations related to nodes

How to contribute

Contribution Guidelines

Coding Guidelines

Product Compatible and additional computed target framework versions.
.NET 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. 
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
1.1.0 95 10/3/2024
1.0.77 83 9/27/2024
1.0.75 129 6/10/2024
1.0.71 93 5/3/2024
1.0.57 149 3/25/2024
1.0.43 604 10/10/2023
1.0.31 900 11/11/2022
1.0.28 371 11/9/2022
1.0.25 610 9/27/2022
1.0.23 596 3/29/2022
1.0.4 587 3/9/2022