Git Product home page Git Product logo

opc-ua-client's Introduction

robot

opc-ua-client

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

Supports Universal Windows Platform (UWP), Windows Presentation Framework (WPF) and now Xamarin Forms 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

  • UaTcpSessionChannel - A fast channel for sending requests to your OPC UA server using the UaTcp binary protocol. Supports security up to Basic256Sha256. 100% asynchronous.
  • UaTcpSessionClient - A client for browsing, reading, writing and subscribing to nodes of your OPC UA server. Connects and reconnects automatically. 100% asynchronous.
  • SubscriptionAttribute - An attribute 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 partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            // Create the session client for the app.
            this.session = new UaTcpSessionClient(
				new ApplicationDescription()
				{
					ApplicationName = "Workstation.StatusHmi",
					ApplicationUri = $"urn:{System.Net.Dns.GetHostName()}:Workstation.StatusHmi",
					ApplicationType = ApplicationType.Client
				},
			    new DirectoryStore(
					Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Workstation.StatusHmi\pki")),
                ed => Task.FromResult<IUserIdentity>(new UserNameIdentity("root", "secret")),
				StatusHmi.Properties.Settings.Default.EndpointUrl);

            // Create the main view model.
            var subscription = new MainViewModel(this.session);

            // Create and show the main view.
            var view = new MainView { DataContext = subscription };

            view.Show();
        }
    }
    
    [Subscription(publishingInterval: 500, keepAliveCount: 20)]
    public class MainViewModel : ViewModelBase
    {
        private readonly UaTcpSessionClient session;

        public MainViewModel(UaTcpSessionClient session)
        {
            this.session = session;
            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.5.2 Signed the assembly. Bug fix to report proper exception if server denies connection due to security.

v1.5.1 Added support for .Net Framework 4.5. Upgraded project to Visual Studio 2017.

v1.5.0 Added support for Xamarin Forms. Introduced ICertificateStore and DirectoryStore.

v1.4.2 UaTcpSessionClient now calls an asynchronous function you provide when connecting to servers that request a X509Certificate.

v1.4.1 Depreciated UaTcpSessionClient.CreateSubscription(), use Subscribe() instead. Modified UserIdentityProvider to be a function of RemoteEndpoint.

v1.4.0 UaTcpSessionClient now calls an asynchronous function you provide when connecting to servers that request a UserNameIdentity. Depreciated ISubscription and replaced with SubscriptionAttribute to specify Subscription parameters. If ViewModelBase implements ISetDataErrorInfo and INotifyDataErrorInfo then it will record any error messages that occur when creating, writing or publishing a MonitoredItem. Diagnostics now use EventSource for logging. Added Debug, Console and File EventListeners.

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 jogibear9988 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.