OPC UA C++ SDK

ogamma OPC UA C++ Client SDK

Summary.

This SDK is intended to extremely simplify the creation of OPC UA Client Applications in modern C++. Implements OPC UA communication stack and provides high-level classes to asynchronously send OPC UA requests and receive responses via callbacks or synchronously.

The primary target and narrow specialization of this SDK are high-performance OPC UA applications running in the PC or cloud environment. It is resource unpretentious and can run in lower-end hardware such as Raspberry PI though, but narrow specialization is to satisfy requirements for enterprise-scale applications.

Key differentiators.

The key differentiators of this SDK from other existing in the market C++ SDKs:

  • Designed following "Low Code" philosophy: applications using it would need to write minimal code. Example of writing value to single node:
WriteRequest::Ptr req(new WriteRequest(WriteValue (NodeId("Demo.Static.Scalar.UInt32", 2), DataValue((uint32_t) 123))));

auto writeResult = connection->send(req).get();

if (writeResult->isGood())
{...}
  • Written in modern C++ (11 or higher);
  • Leverages existing open-source libraries (boost for asynchronous communication, Botan for cryptography) to shorten time to market and reduce development costs;
  • Does not depend on OPC Foundation's ANSI C Stack, has its own stack implementation.
  • Asynchronous and synchronous interface. Uses std::future to return results and optionally possible to handle result via callbacks defined as std::function. Callbacks are called from dedicated to those threads, so they do not affect other threads such as IO service threads. This simplifies using the SDK for GUI applications for example.
  • Automatic re-connection with automatic creation of subscriptions and adding monitored items.
  • Feature to create subscriptions and monitored items when the server is offline - they will be created on the server-side automatically when the server becomes online.
  • No server-side handles are exposed - instead, the static client handles defined by the application are used, which simplifies mapping of received data changes to the right recipient after re-connections for example.

Features.

Currently following below features are implemented:

  • Establishing TCP connection and initial handshake (OPC UA Hello, Acknowledge and Error messages);
  • Implemented OPC UA Services:
    • OpenSecureChannel
    • FindServers
    • GetEndpoints
    • CreateSession
    • ActivateSession
    • Call
    • Read
    • Write
    • HistoryRead
    • Browse
    • BrowseNext
    • CreateSubscription
    • DeleteSubscriptions
    • CreateMonitoredItems (for Data Changes only, no Alarms/Events)
    • DeleteMonitoredItems;
    • Publish
    • CloseSession
    • CloseSecureChannel
  • Communication in secured mode and infrastructure to support it:
    • Automatically generating self-signed root certificate and application instance certificate signed by it;
    • Creation of secure channel in secured mode (sign and encryption).
    • Supported security policies:
      • Basic256Sha256
      • None
  • OPC Binary encoding is implemented for data types, which are required to send requests and receive responses for functionality listed above.
  • Support for complex data types: Encoding and Decoding of complex data type values can be handled by the user application, so no need to modify the SDK to support unknown complex types.
  • Supported user identity token types:
    • Anonymous
    • Username/password

Licensing.

For open-source projects, research, education, and non-commercial organizations, as well as for personal usage by developers free binary license is available.

For detailed licensing information please refer Developer's Guide, the section on licensing, here.

Developer's Guide and Youtube video.

Trial version with header files and pre-built binaries is available to try. For details, refer to the Developer's Guide.

Introduction video on YouTube: https://youtu.be/RJDpdx5xU8w

GitHub page.

The product home page at GitHub is used for issue tracking.

How to buy.

For quotes to purchase licenses for commercial use please contact us.