Skip to content

Commit

Permalink
Merge pull request #49 from fledge-iot/2.5.0RC
Browse files Browse the repository at this point in the history
2.5.0RC
  • Loading branch information
dianomicbot authored Jul 1, 2024
2 parents e59ca12 + eea48bd commit 011a196
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 98 deletions.
20 changes: 6 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
fledge-north-opcua
===================

Fledge North Plugin that acts as an OPCUA server
Fledge North Plugin that acts as an OPC UA server

This is a proof of concept OPC UA server that can be run in the sending
process of Fledge to make Fledge appear as an OPC UA server.
This plugin does not send data to a destination system but rather acts as an OPC UA Server to which OPC UA clients can connect.
This server's OPC UA Address Space is created from Readings received from the Fledge storage.
It supports retrieval of current data values and data updates through OPC UA Subscriptions.
It does not support historical data retrieval.

Configuration options
---------------------

url
The URL which the OPC UA server will offer to any OPC UA clients.

uri
The URN of the server provider

namespace
The namespace registration for OPC UA
For configuration options, see the `documentation page <docs/index.rst>`_.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0
2.5.0
Binary file modified docs/images/opcua_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ This second page allows for the setting of the configuration within the OPC UA s
It can occur that the Asset Name in an incoming Reading does not reflect the owning object and that the proper name will be found in the hierarchy definition.
If this is the case, uncheck this box.

- **Parse Hierarchy from Asset Name**: The plugin can parse a slash-separated path string to create an OPC UA Address Space hierarchy (see :ref:`Parsing_of_Full_Paths`).
In some configurations, the Asset Name contains part of (or all of) the path.
If this setting is true, parse the Asset Name and add any slash-separated path segments to the end of the path.

- **Hierarchy**: This allows you to define a hierarchy for the OPC UA objects that is based on the meta data within the readings. See below for the definition of hierarchies.

- **Control Root**: The root node under which all control nodes will be created in the OPC UA server.
Expand Down Expand Up @@ -126,6 +130,8 @@ The data would be shown in the OPC UA server in the following structure:
Any data that does not fit this structure will be stored at the root.

.. _Parsing_of_Full_Paths:

Parsing of Full Paths
~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion fledge.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fledge_version>=2.4
fledge_version>=2.5
7 changes: 5 additions & 2 deletions include/opcua.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef _OPCUASERVER_H
#define _OPCUASERVER_H
#include <map>
#include <stack>
#include <reading.h>
#include <config_category.h>
#include <logger.h>
#include <string>
#include <map>
#include <opc/ua/node.h>
#include <opc/ua/subscription.h>
#include <opc/ua/server/server.h>
Expand Down Expand Up @@ -84,8 +85,9 @@ class OPCUAServer {
std::string& name, DatapointValue& value, struct timeval userTS);
void updateDatapoint(std::string& assetName, OpcUa::Node& obj,
std::string& name, DatapointValue& value, struct timeval userTS);
OpcUa::Node createHierarchyFromPathSegments(std::stack<std::string> &pathSegments, const OpcUa::Node &root, std::string &key);
OpcUa::Node findParent(const Reading *reading);
OpcUa::Node& findParent(const std::vector<NodeTree>& hierarchy, const Reading *reading, OpcUa::Node& root, std::string key);
OpcUa::Node findParent(const std::vector<NodeTree>& hierarchy, const Reading *reading, OpcUa::Node& root, std::string key);
void parseChildren(NodeTree& parent, const rapidjson::Value& value);
void addControlNode(const std::string& name, const std::string& type);
void addControlNode(const std::string& name, const std::string& type, ControlDestination dest, const std::string& arg);
Expand All @@ -100,6 +102,7 @@ class OPCUAServer {
std::string m_namespace;
std::string m_root;
bool m_includeAsset;
bool m_parseAsset;
int m_idx;
OpcUa::Node m_objects;
Logger *m_log;
Expand Down
Loading

0 comments on commit 011a196

Please sign in to comment.