• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Samples and tutorials to illustrate how to build OPC UA PubSub applications.

OPC UA IIoT StarterKit

Overview

OPC UA PubSub is an extension to OPC UA that enables communication between OPC UA applications using a Publish-Subscribe message pattern instead of the Request-Response message pattern. The Publish-Subscribe message pattern decouples senders of messages from their receivers which allows for the development if systems based on middleware such as an MQTT broker. The difference between the two patterns is illustrated in the following figure:

PubSub Overview

The Publish-Subscribe message pattern is a powerful tool for factory owners that want to collect data from large numbers of publishers. In particular, it is a technology that is well suited for publishing factory data to the cloud. Publish-Subscribe is not well suited for use cases, such as device configuration, where a Client is blocked until it receives information back from the Server. OPC UA supports both message patterns because it is the best way to meet the complex needs of modern factories.

The purpose of this starter is to provide a bare bones implementation of OPC UA PubSub which illustrates the following:

  1. Implementing OPC UA PubSub is easy to do using standard Open-source libraries;
  2. OPC UA PubSub allows Subscribers discover Publishers and metadata about what they are publishing;
  3. How to integrating OPC UA PubSub with OPC Client-Server.

Changes

Date Changes
2021-12-01 Added command line arguments to set MQTT broker username/password.
2022-07-30 Major update to support the draft topics defined by the specification and support for actions and binary data.
2023-11-06 Major update to support the 1.05.03 version of the specification. Features that have not been released have been removed for now.

Licence and Usage Model

The code in this repository is covered under the MIT license, however, some of the applications link to the UA-.NETStandard project which is has a dual license model. Note that Quickstarts 001 through 003 do not use the UA-.NETStandard stack and show how to implement a basic PubSub application using only MIT licenced code.

This code is developed as a learning tool and is missing some of the features that a commercial product would require, such as robust error handling.

Requirements

This StarterKit contains software designed to run on a Raspberry Pi or other Linux device with GPIO ports.

It will also run on a Linux or Windows machine without GPIO ports in simulation mode.

This version of StarterKit uses .NET 6.0.

The recommended development tool to build for the Raspberry Pi is Visual Studio Code

The recommended development tool to build for Windows platforms is Visual Studio 2022.

An MQTT broker is required. Eclipse Mosquitto is used in the StarterKit documentation.

A MQTT monitoring application, such as MQTT Spy, is also helpful.

All of the code and documentation can be found on GitHub.

Next Steps

  1. Setting up the Build Environment

    1.1 Linux
    1.2 Raspberry Pi with a Windows Development Environment

  2. Quickstarts

    2.1 Building a Simple Publisher and Subscriber
    2.2 Describing the Content of Data Messages
    2.3 Using Connection Metadata to discover Message Structure
    2.4 Acquiring Data from an OPC UA Server
    2.5 Handling Multiple Header Profiles

  3. Complete Applications

    3.1 Publisher
    3.2 Subscriber

More Repositories

1

UA-.NETStandard

OPC Unified Architecture .NET Standard
C#
1,906
star
2

UA-Java-Legacy

This repository is provided by OPC Foundation as legacy support for an Java version for OPC UA.
Java
355
star
3

UA-.NET-Legacy

OPC Foundation Unified Architecture .NET Reference Implementations
C#
330
star
4

UA-.NETStandard-Samples

C#
246
star
5

UA-Nodeset

UA Nodeset
C#
217
star
6

UA-ModelCompiler

ModelCompiler converts XML files into C# and ANSI C
C#
151
star
7

UA-LDS

Local Discovery Server
C
45
star
8

Misc-Tools

Miscellaneous utilities
C#
42
star
9

UA-CloudLibrary

OPC UA Information Model database with a REST and GraphQL interface, as well as user management. The global instance of this (hosted by the OPC Foundation) can be found at https://uacloudlibrary.opcfoundation.org.
C#
39
star
10

UA-CloudViewer

A tool to manage OPC UA information models ("industrial digital twins"). UA Cloud Viewer is a tool used in Industrial IoT scenarios to bridge the gap from OT to IT. OPC UA is the standard interface for vendor-neutral Operational Technology (OT) interoperability in factories, plants and renewable energy farms.
JavaScript
32
star
11

UA-EdgeTranslator

An industrial connectivity edge application translating from proprietary protocols to OPC UA leveraging the W3C Web of Things (WoT) thing descriptions.
C#
28
star
12

UA-CloudDashboard

A cross-platform OPC UA cloud dashboard reference implementation leveraging MQTT. It runs in a Docker container and displays OPC UA PubSub telemetry data, read directly from an MQTT broker or Azure EventHub/IoT Hub. It supports both JSON and binary payloads as well as OPC UA Complex Types decoding.
JavaScript
21
star
13

UA-CloudCommander

A cross-platform OPC UA cloud command & control reference implementation leveraging MQTT and Kafka. It runs in a Docker container and executing commands, reads and writes on on-prem OPC UA servers from the cloud.
C#
20
star
14

opcfoundation.github.io

About the OPC Foundation and OPC Technology
CSS
11
star
15

UA-CloudMetaverse

OPC UA Metaverse reference implementation leveraging Unity
ShaderLab
11
star
16

UA-CloudAction

An OPC UA Cloud-based Action which calls UA Cloud Commander on the Edge via Kafka.
C#
5
star
17

opcua-webapi-dotnet

C#
1
star