Coder Social home page Coder Social logo

opc-ua-client's Introduction

robot

opc-ua-client

New! Install package 'Workstation.UaClient' from Nuget to get the latest release for your hmi project.

New! Supports Universal Windows Platform (UWP) and Windows Presentation Framework (WPF) applications.

Build a free HMI using OPC Unified Architecture and Visual Studio. With this library, your app can browse, read, write and subscribe to the live data published by the OPC UA servers on your network.

Get the companion Visual Studio extension 'Workstation.UaBrowser' and you can:

  • Browse OPC UA servers directly from the Visual Studio IDE.
  • Drag and drop the variables, methods and events onto your view model.
  • Use XAML bindings to connect your UI elements to live data.

Main Types

  • UaTcpSessionClient - A client for browsing, reading, writing and subscribing to nodes of your OPC UA server. Connects and reconnects automatically. 100% asynchronous.
  • ISubscription - An interface for your view models. Permits UaTcpSessionClient to automatically create and delete subscriptions on the server and deliver data change and event notifications to properties.
  • MonitoredItemAttribute - An attribute for properties that indicates the property will receive data change or event notifications from the server.
    public class AppDescription : ApplicationDescription
    {
        public AppDescription()
        {
            this.ApplicationName = "Workstation.RobotHmi";
            this.ApplicationUri = $"urn:{System.Net.Dns.GetHostName()}:Workstation.RobotHmi";
            this.ApplicationType = ApplicationType.Client;
        }
    }

    public class PLC1Service : UaTcpSessionClient
    {
        public PLC1Service(AppDescription description)
            : base(description, description.GetCertificate(), null, "opc.tcp://localhost:26543")
        {
        }
    }
    
    public class MyViewModel : ViewModelBase, ISubscription
    {
        public MyViewModel(PLC1Service session)
        {
            this.PublishingInterval = 500.0;
            session?.Subscribe(this);
        }

        /// <summary>
        /// Gets the value of ServerStatusCurrentTime.
        /// </summary>
        [MonitoredItem(nodeId: "i=2258")]
        public DateTime ServerStatusCurrentTime
        {
            get { return this.serverStatusCurrentTime; }
            private set { this.SetProperty(ref this.serverStatusCurrentTime, value); }
        }

        private DateTime serverStatusCurrentTime;
    }

Releases

v1.3.0 Depreciated Subscription base class in favor of ISubscription interface to allow freedom to choose whatever base class you wish for your view models.

v1.2.0 Client, Subscription and Channel class constructors have new optional arguments. Corresponding property setters are removed to prevent changes after construction. Fixed some threading issues: Subscription's publish on thread pool, viewmodel's update on dispatcher thread.

v1.1.0 Simplified Subscription base class to automatically subscribe for data change and event notifications when constructed, re-subscribe if the server reboots, and un-subscribe when garbage collected.

v1.0.0 First commit. Includes UaTcpSessionChannel for 'opc.tcp' servers. Supports security up to Basic256Sha256. Automatically creates self-signed X509Certificate with 2048bit key.

opc-ua-client's People

Contributors

awcullen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.