Giter Site home page Giter Site logo

hhdang / opc-ua-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from convertersystems/opc-ua-client

0.0 2.0 0.0 3.12 MB

Visualize and control your enterprise using OPC Unified Architecture (OPC UA) and Visual Studio.

License: MIT License

C# 100.00%

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 Xamarin applications.

Build a 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 channel for sending requests to your OPC UA server using the UaTcp binary protocol. Supports security up to Basic256Sha256. 100% asynchronous.
  • UaApplication - A service for managing the channels to your OPC UA servers. Connects and reconnects automatically. 100% asynchronous.
  • SubscriptionBase - A base class for view models that receive data change or event notifications from the server.
  • SubscriptionAttribute - An attribute for your view models to specify the OPC UA server and subscription properties.
  • MonitoredItemAttribute - An attribute for your properties that indicates the property will receive data change or event notifications from the server.
    public partial class App : Application
    {
        private ILoggerFactory loggerFactory;
        private UaApplication application;

        protected override void OnStartup(StartupEventArgs e)
        {
            // Setup a logger.
            this.loggerFactory = new LoggerFactory();
            this.loggerFactory.AddDebug(LogLevel.Trace);

            // Build and run an OPC UA application instance.
            this.application = new UaApplicationBuilder()
                .UseApplicationUri($"urn:{Dns.GetHostName()}:Workstation.StatusHmi")
                .UseDirectoryStore($"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Workstation.StatusHmi\\pki")
                .UseIdentity(this.ShowSignInDialog)
                .UseLoggerFactory(this.loggerFactory)
                .Build();

            this.application.Run();

            // Create and show the main view.
            var view = new MainView();
            view.Show();
            base.OnStartup(e);
        }
		...
    }
    
    [Subscription(endpointUrl: "opc.tcp://localhost:26543", publishingInterval: 500, keepAliveCount: 20)]
    public class MainViewModel : SubscriptionBase
    {
        /// <summary>
        /// Gets the value of ServerServerStatus.
        /// </summary>
        [MonitoredItem(nodeId: "i=2256")]
        public ServerStatusDataType ServerServerStatus
        {
            get { return this.serverServerStatus; }
            private set { this.SetValue(ref this.serverServerStatus, value); }
        }

        private ServerStatusDataType serverServerStatus;
    }

opc-ua-client's People

Contributors

awcullen avatar jogibear9988 avatar

Watchers

James Cloos avatar  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.