All Projects → hylasoft-usa → H Opc

hylasoft-usa / H Opc

Licence: mit
OPC client made simpler, for UA and DA

Projects that are alternatives of or similar to H Opc

Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (-7.66%)
Mutual labels:  monitoring, client
Watsontcp
WatsonTcp is the easiest way to build TCP-based clients and servers in C#.
Stars: ✭ 209 (+0%)
Mutual labels:  client
Jenkins Rest
Java client, built on top of jclouds, for working with Jenkins REST API
Stars: ✭ 201 (-3.83%)
Mutual labels:  client
Verb
Organize and send HTTP requests from Emacs
Stars: ✭ 205 (-1.91%)
Mutual labels:  client
Lttng Tools
The lttng-tools project provides a session daemon (lttng-sessiond) that acts as a tracing registry, the "lttng" command line for tracing control, a lttng-ctl library for tracing control and a lttng-relayd for network streaming.
Stars: ✭ 202 (-3.35%)
Mutual labels:  monitoring
Awesome Prometheus Alerts
🚨 Collection of Prometheus alerting rules
Stars: ✭ 3,323 (+1489.95%)
Mutual labels:  monitoring
Gpustat
📊 A simple command-line utility for querying and monitoring GPU status
Stars: ✭ 2,662 (+1173.68%)
Mutual labels:  monitoring
Minicron
🕰️ Monitor your cron jobs
Stars: ✭ 2,351 (+1024.88%)
Mutual labels:  monitoring
Csharpgameframework
基于unity3d引擎与c#语言的游戏框架/架构(包括客户端与服务器)。使用ServerPlatform作为服务端通信基础设施。
Stars: ✭ 208 (-0.48%)
Mutual labels:  client
Pginsight
CLI tool to easily dig deep inside your Postgresql database.
Stars: ✭ 205 (-1.91%)
Mutual labels:  monitoring
Surfer
Package surfer is a high level concurrency http client. It has surf andphantom download engines, highly simulated browser behavior, the function of analog login and so on.
Stars: ✭ 204 (-2.39%)
Mutual labels:  client
Oksocket
An blocking socket client for Android applications.
Stars: ✭ 2,359 (+1028.71%)
Mutual labels:  client
Iobroker.admin
user interface for configuration and administration
Stars: ✭ 207 (-0.96%)
Mutual labels:  monitoring
Nats Top
A top-like tool for monitoring NATS servers.
Stars: ✭ 202 (-3.35%)
Mutual labels:  monitoring
Oracledb exporter
Prometheus Oracle database exporter.
Stars: ✭ 209 (+0%)
Mutual labels:  monitoring
Kubernetes Kargo Logging Monitoring
Deploy kubernetes cluster with kargo
Stars: ✭ 202 (-3.35%)
Mutual labels:  monitoring
Kenshin
Kenshin: A time-series database alternative to Graphite Whisper with 40x improvement in IOPS
Stars: ✭ 203 (-2.87%)
Mutual labels:  monitoring
Openapi Sdk Php Client
Official repository of the Alibaba Cloud Client for PHP
Stars: ✭ 206 (-1.44%)
Mutual labels:  client
Phpnats
A PHP client for the NATSio cloud messaging system.
Stars: ✭ 209 (+0%)
Mutual labels:  client
Nginx Module Vts
Nginx virtual host traffic status module
Stars: ✭ 2,518 (+1104.78%)
Mutual labels:  monitoring

h-opc Build status NuGet Status Coverage Status

An Opc Library and a command line to perform OPC operations with ease and transparency among different protocols. Currently supports synchronous operation over UA and DA protocols.

Table of Contents

Use

A nuget package is available for the library. To install H.Opc, run the following command in the Package Manager Console:

PM> Install-Package H.Opc

NOTE: Package was moved on NuGet.org from Hylasoft.Opc to H.Opc because of NuGet account issues

To install the command line interface, head to the release section.

Documentation

to use the UA Client simply...

using (var client = new UaClient(new Uri("opc.tcp://host-url")))
{
  client.Connect();
  // Use `client` here
}

or with options...

var options = new UaClientOptions {
  UserIdentity = new Opc.Ua.UserIdentity("<your-username>", "<your-password>")
};
using (var client = new UaClient(new Uri("opc.tcp://host-url")), options)
{
  client.Connect();
  // Use `client` here
}

and to use the DA Client instead:

using (var client = new DaClient(new Uri("opcda://host-url")))
{
  client.Connect();
  // Use `client` here
}

Exploring the nodes

You can get a reference to a node with...

var node = client.FindNode("path.to.my.node");

This will get you a reference to the node node in the folder path.to.my.

You can use the node reference to explore the hieriarchy of nodes with the properties Parent and SubNodes. For example...

Node parentNode = node.Parent;
IEnumerable<Node> children = client.ExploreFolder(node.Tag);
IENumerable<Node> grandChildren = children.SelectMany(m => client.ExploreFolder(m.Tag));

Read a node

Reading a variable? As simple as...

var myString = client.Read<string>("path.to.string").Value;
var myInt = client.Read<int>("path.to.num").Value;

The example above will read a string from the tags string and num in the folder path.to

Writing to a node

To write a value just...

client.Write("path.to.string", "My new value");
client.Write("path.to.num", 42);

Monitoring a tag

Dead-simple monitoring:

client.Monitor<string>("path.to.string", (readEvent, unsubscribe) =>
{
  DoSomethingWithYourValue(readEvent.Value);
  if(ThatsEnough == true)
    unsubscribe();
});

The second parameter is an Action<T, Action> that has two parameter:

  • readEvent contains all the information relevant to the event such as timestamps, quality and the value
  • unsubscribe is a function that unsubscribes the current monitored item. It's very handy when you want to terminate your callback

it's important that you either enclose the client into a using statement or call Dispose() when you are finished, to unsubscribe all the monitored items and terminate the connection!

Go Asynchronous!

Each method as an asynchornous counterpart that can be used with the async/await syntax. The asynchronous syntax is recommended over the synchronous one (maybe the synchronous one will be deprecated one day).

Command line

You can also use the command line interface project to quickly test your an OPC. Build the h-opc-cli project or download it from the release page of this repository, then run:

h-opc-cli.exe [OpcType] [server-url]

Where OpcType is the type of opc to use (e.g: "UA", "DA"). Once the project is running, you can use the internal command to manipulate the variable. To have more information aboute the internal commands, type help or ?

Build + Contribute

The repository uses cs-boilerplate. Read the readme of the cs-boilerplate repository to understand how to build, run tasks and commit your work to master.

Unit Testing

  • The unit tests rely on locally running simulator OPC servers. The ones used in this project are OPC Foundation's Sample Server and Graybox Simulator
    • You must download OPC Foundation's Sample Server from the OPC Foundation website (link above), but GrayBox can be downloaded using Chocolatey
      • choco install grayboxsimulator
    • OPC Foundation's Sample Server requires you register with the website before you can download.
  • The tests use NUnit. To run them in Visual Studio, install the NUnit 3 Test Adapter
  • To configure the test project, run the configure.ps1 script in the root h-opc directory

UA

  • Open OPC Foundation's Sample Client (under Start -> OPC Foundation -> UA x.xx -> Sample Applications -> Opc.Ua.SampleClient.exe)
    • This will start the server too
    • Running tests will only work with this program open

DA

  • With Graybox Simulator installed, tests should automatically work

Disclaimer

The following binaries belong to the OPC Foundation. You must become a registered user in order to use them:

  • OPC.Ua.Client.dll
  • OPC.Ua.Core.dll
  • OPC.Ua.Configuration.dll
  • OpcComRcw.dll
  • OpcNetApi.Com.dll
  • OpcNetApi.dll

You must agree to the terms and condition exposed on the OPC Foundation website. Hyla Soft is not responsible of their usage and cannot be held responsible.

Roadmap

  • [ ] Add promise-based asynchronous calls
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].