Object-Oriented Internet
  • Executive Summary
  • Table of Content
  • Introduction
    • Introduction to Object-Oriented Internet
    • Introduction to Complex Data Processing
    • OPC Unified Architecture
    • OPC UA Main Technology Features
  • Semantic-Data Processing
    • Semantic-Data Processing Architecture
    • Address Space and Address Space Model
    • UA Information Model - Concept
      • Standard Information Model
    • Information Models Development
      • Adopting Companion Standard Models - Analyzer Devices Integration
      • Companion Specification - Information Model for Analyzers
      • ADI Information Model Adoption
      • ADI Model Deployment
      • Address Space Model Life-cycle
      • Design and Deployment Support
    • Address Space Management Implementation
    • Address Space Prototyping Tool (asp.exe)
      • UAModelDesignExport Library
  • Internet of Things (IoT) Archetype
    • Semantic-Data Message Centric Communication
    • Internet of Things (IoT) Communication
  • Reactive Communication
    • UA Part 14: PubSub Main Technology Features
    • Reactive Networking of Semantic-Data Library
      • Underlying Transport over UDP
      • Underlying Transport over MQTT
      • Underlying Transport over AMQP
      • Underlying Transport over Ethernet
      • DataSet and Communication Channel Association
      • Encoding Library
    • Getting Started Tutorial
    • Walk-through ReferenceApplication
      • ReferenceApplication Utilities
      • Azure Gateway DataRepository
      • ReferenceApplication Consumer - Data Logger
      • ReferenceApplication Producer - Interoperability Test Data Generator
      • ReferenceApplication Producer - Boilers Set Simulator
  • Configuration
    • Configuration - Executive Summary
      • Reactive Networking (RxNetworking) Configuration
      • DataBinding library
  • Global Data Discovery
    • Concept
    • Domain Model
  • References
    • See also
Powered by GitBook
On this page
  • Common Tasks
  • How to Guide
  • How to: Implement DataManagementSetup
  • How to: Implement IBindingFactory
  • How to: Implement IConfigurationFactory
  • Current release
  • See also

Was this helpful?

Edit on GitHub
  1. Reactive Communication
  2. Walk-through ReferenceApplication

ReferenceApplication Consumer - Data Logger

PreviousAzure Gateway DataRepositoryNextReferenceApplication Producer - Interoperability Test Data Generator

Last updated 2 years ago

Was this helpful?

Common Tasks

Working through this tutorial gives you an introductory understanding of the steps required to implement Consumer role of OOI Reactive Application. DataLogger is a sample implementation of the Consumer part of the ReferenceApplication, which is an example application of Semantic-Data reactive networking based on specification.

Here are steps undertook to implement the Consumer role in the application:

  1. DataManagementSetup: this class has been overridden by the LoggerManagementSetupclass and it initializes the communication and binds data fields recovered form messages to local resources.

  2. IEncodingFactory and IMessageHandlerFactory: has been implemented in external common libraries and Consumer doesn't depend on this implementation - current implementation of the interfaces is localized as services using an instance of the IServiceLocator interface.

  3. IBindingFactory: has been implemented in the class DataConsumer that is responsible to synchronize the values of the local data repository properties and messages received over the wire.

  4. IConfigurationFactory: the class ConsumerConfigurationFactory implements this interface to be used for the configuration file opening.

How to Guide

How to: Implement DataManagementSetup

The LoggerManagementSetup constructor initializes all properties, which are injection points of all parts composing this role.

  public sealed class LoggerManagementSetup : DataManagementSetup
  {
    public LoggerManagementSetup()
    {
      IServiceLocator _serviceLocator = ServiceLocator.Current;
      string _ConsumerConfigurationFileName = _serviceLocator.GetInstance<string>(ConsumerCompositionSettings.ConfigurationFileNameContract);
      m_ViewModel = _serviceLocator.GetInstance<ConsumerViewModel>(ConsumerCompositionSettings.ViewModelContract);
      ConfigurationFactory = new ConsumerConfigurationFactory(_ConsumerConfigurationFileName);
      EncodingFactory = _serviceLocator.GetInstance<IEncodingFactory>();
      BindingFactory = new DataConsumer(m_ViewModel);
      MessageHandlerFactory = _serviceLocator.GetInstance<IMessageHandlerFactory>();
    }

    ....

  }

Finally the DataManagementSetup.Start() method is called to initialize the infrastructure, enable all associations and start pumping the data.

How to: Implement IBindingFactory

Implementation of this interface is a basic step to implement Consumer functionality. An instance of the IBindingFactory is responsible to create objects implementing IBinding that can be used by the Consumer to save the data received over the wire in the local data repository.

How to: Implement IConfigurationFactory


string _ConsumerConfigurationFileName = _serviceLocator.GetInstance<string>(ConsumerCompositionSettings.ConfigurationFileNameContract);

Current release

Note; This library is not considered to be published as the NuGet package.

See also

In this example, it is assumed that is implemented to resolve references to any external services.

The class DataConsumer is a sample implementation of a data logger functionality recording data over time. It consumes the testing data sent and updates properties in the class ConsumerViewModel implementing ViewModel layer in the (MVVM pattern). The class DataConsumer demonstrates how to create bindings interconnecting the data received over the wire and the properties that are the ultimate destination of the data. The user interface provided by the View layer implemented in the UAOOI.Networking.ReferenceApplication.MainWindow class is dynamically bounded at run time with the ConsumerViewModel. To implement the ViewModel layer in the *MVVM pattern* the helper generic class UAOOI.Networking.SemanticData.DataRepository.ProducerBindingMonitoredValue` is used.

Implementation of this interface is straightforward and based entirely on the library . In a typical scenario, this implementation should not be considered for further modification. The only open question is how to provide the name of the file containing the configuration of this role. In proposed solution the name is provided by a service defined by the application entry point part and localized using IServiceLocator in the class LoggerManagementSetup - see code snipped below:

This role uses independent configuration file ConfigurationDataConsumer.xml attached to the project. This file contains a mirror configuration of the role configuration to log all the generated data.

API Browser: the preliminary code help documentation -

OPC UA Part 14 Pub/Sub
ServiceLocator
Model View ViewModel (on MSDN)
UAOOI.Configuration.Networking
Producer
available for sponsors- consider joining
OPC UA Makes Complex Data Processing Possible