Skip to content

Commit

Permalink
deploy: 7ad9271
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianDue committed Jul 17, 2024
0 parents commit ecb57d5
Show file tree
Hide file tree
Showing 69 changed files with 7,543 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: de94cdecb3f5861b9a0c058f086cbc93
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
Binary file added _images/moduleType.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/queue.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions _sources/browse_module.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)


==========================
Browse ModuleType Instance
==========================
The following functions can be used to identify single nodes within the instance of the ModuleType. However, as the Instance only features Organizes, HasComponent and HasProperty References,
Nodes that are added with different references will not be found. Since the Instance features an undetermined Namespace Index, only the Name of the QualifiedName is used for the node matching. Consequently,
BrowseNames of Nodes within the Instance must have unique BrowseNames

.. code-block:: c
/*
* Method with which a server finds a node based on its browsename
* Arguments:
* UA_Server *server: server instance
* UA_QualifiedName node_name: Browsename of the target node, matching is only based on its Name, not on the NamespaceIndex
* UA_NodeId *node_nodeId: Pointer to a NodeId which returns the NodeId of the requested node
*/
UA_StatusCode get_single_node(UA_Server *server,
UA_QualifiedName node_name,
UA_NodeId *node_nodeId);
/*
* Method with which a client finds a node based on its browsename
* Arguments:
* UA_Client *client: client instance
* UA_QualifiedName node_name: Browsename of the target node, matching is only based on its Name, not on the NamespaceIndex
* UA_NodeId *node_nodeId: Pointer to a NodeId which returns the NodeId of the requested node
*/
UA_StatusCode client_get_single_node(UA_Client *client,
UA_QualifiedName node_name,
UA_NodeId *node_nodeId);
15 changes: 15 additions & 0 deletions _sources/contact.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
..
Copyright The Demonstration Scenario Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)


========
Contact
========

For further questions about the SWAP-IT software components or the patient zero application,
please contact Florian Düwel ([email protected]) or Andreas Ebner ([email protected]).
35 changes: 35 additions & 0 deletions _sources/glossary.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
..
Copyright The Demonstration Scenario Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)


========
Glossary
========
.. glossary::

PFDL Scheduler
Generates a petri net out of a PFDL description of a process and schedules the specified services and tasks.

Execution Engine
Interface between the PFDL scheduler and field level resources that executes the scheduled services on the field level. In addition, it handles the parameter flow between services and tasks.

Process Agent
Agent consisting of a PFDL scheduler and an Execution Engine. It drives the execution of the process specified within a PFDL.

Device Registry
Registry Module where resource OPC UA server, representing field level devices, can register themself and thus, make themself available to execute PFDL services. In addition,
the Device Registry has a build-in functionality to filter suitable resources for a service execution based on a resource's capabilities.

Assignment Agent
Entity that interacts with an Execution Engine and a Device Registry to assign a service to one concrete resource out of a set of possible resources.

OPC UA Information Model
Contains all nodes and references to map a specific entity to an OPC UA server.

PFDL
The Production Flow Description Language is a domain specific language that describes a production order. It is parsed by the scheduler and transformed into a structure to schedule the execution.
30 changes: 30 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)

.. toctree::
:maxdepth: 2

==========================
Open62541 Server Template
==========================

This library is part of the SWAP-IT software modules and builds on the open62541 open source OPC UA SDK (https://www.open62541.org/). This software module provides a set of utility functions that can
transform any open62541 based OPC UA server application into a SWAP-IT application. Consequently, the server application will be extended with an additional set ob OPC UA Objects, Variables
and Methods to interact with other SWAP-IT software modules. The software requires a custom information model which extends the Common Information Model, as well as a JSON configuration to
customize the added information model.


.. toctree::
:maxdepth: 2

informationmodels
json
util
related_projects
glossary
contact
21 changes: 21 additions & 0 deletions _sources/informationmodels.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)

==================
Information Models
==================

To configure a server for the SWAP-IT architecture, an instance of a SubType of the abstract ModuleType is required, so that a custom information model that extends the `SWAP-IT Common Information Model <https://github.com/FraunhoferIOSB/swap-it-common-information-model>`_
must be provided. Within this custom information model, the Services Object
of the Common Information Model's ModuleType has to be extended with a custom asset-specific OPC UA Method. To invoke this method from SWAP-IT software modules, its BrowseName must correspond
to service definition in PFDL (Production Flow Description Language)
descriptions. Besides, the custom information model must provide a corresponding EventType as SubType of the ServiceFinishedEventType and just like with the method, the BrowseName must
be equal to the name of the PFDL service.

.. figure:: /images/moduleType.PNG
:alt: alternate text
39 changes: 39 additions & 0 deletions _sources/interpret_conf.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)

.. _Interpret Server Configuration:

===============================
Interpret Server Configuration
===============================

.. code-block:: c
/*Structure type that holds all information of a json-based swap-it configuration of a server*/
typedef struct{
char *server_name;
UA_UInt16 port;
UA_UInt16 channels;
UA_UInt16 sessions;
char *module_type;
char *module_name;
char *service_name;
char **registry_subscriptions;
size_t nbr_registry_subscriptions;
UA_capabilities *capabilities;
size_t nbr_capabilities;
}UA_service_server_interpreter;
/*
* Method to interpret a swap-it server configuration
* Arguments:
* UA_service_server_interpreter *swap_server: Structure that returns all information from the json configuration
* UA_ByteString json: UA_ByteString that holds a json payload with the swap-it configuration for a server
*/
UA_StatusCode get_server_dict(UA_service_server_interpreter *swap_server,
UA_ByteString json);
76 changes: 76 additions & 0 deletions _sources/json.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)

==================
JSON Configuration
==================

The following illustrates the required JSON configuration that must be provided as input for the UA_Server_swap_it method. The values for the corresponding fields must be provided as string values.

.. code-block:: javascript
{
//mandatory elements
application_name:"string",
resource_ip:"string",
port:"string",
module_type:"string",
module_name:"string",
service_name:"string",
//optional elements
Capabilities:[
{
variable_name:"string",
variable_type:"string",
variable_value:"string",
relational_operator:"string"
},
{
variable_name:"string",
variable_type:"string",
variable_value:"string",
relational_operator:"string"
}
],
channels:string,
sessions:string
}
Mandatory Fields
================

- application_name: Name of the server application
- resource_ip: IP address of the device
- port: Port of the server
- module_type: Name of the custom defined module type in the custom information model.
- module_name: Target BrowseName of the module_tpe instance.
- service_name: Name of the service that should be executed from SWAP-IT software modules.

Optional Fields
===============
The optional arguments enable a user to add custom capabilities to a server, or to change default settings of the server.

- channels: Number of secure channels provided by the server. If not set, the default number of open62541 server is used
- sessions: Number of parallel sessions the server allows. If not set, the default number of open62541 server is used.

Capabilities
------------
The capabilities specified within the JSON configuration are linked to the Capabilities Object. The Common Information Model
defines an abstract Capability_Data_Type, as well as three non abstract subtypes:

- Capability_Struct_Boolean: a boolean value will be added with the "IsTrue" and "IsFalse" as possible relational operators. The variable_type field has to be set to "bool".
- Capability_Struct_String: a string value will be added with "StringEqual" as relational operator. The variable_type field has to be set to "string".
- Capability-Struct_Number: a double value will be added with relational operators: "Equal", "Greater", "Smaller", "GreaterOrEqual", "SmallerOrEqual". The variable_type field has to be set to "numeric".

Each capability element is characterized by a:

- capability_name: BrowseName of the Capability
- capability_type: Distinguished whether the Capability_Struct_Boolean, Capability_Struct_String or the Capability_Struct_Number is used as DataType for added capability variable.
- capability_value: Value of the capability variable.
- relational_operator: Sets a relational operator in which basis the capability can be matched to product capabilities.
48 changes: 48 additions & 0 deletions _sources/module.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)

.. _Instantiate Module:

==================
Instantiate Module
==================

.. code-block:: c
/* Method to crate an instance of the ModuleType, specified in the service_server pointer
* Arguments:
* UA_Server *server: server instance
* UA_service_server_interpreter *service_server: server configuration, including the BrowseName of the SubType of the ModuleType,
* as well as the target browseName of the instance
* UA_NodeId *module_type_instance_nodeId: Pointer to a NodeId which will return the NodeId of the instance of the ModuleType
*/
UA_StatusCode instantiate_module_type(UA_Server *server,
UA_service_server_interpreter *service_server,
UA_NodeId *module_type_instance_nodeId);
/* Method to crate an instance of the ModuleType, specified in the service_server pointer
* Arguments:
* UA_Server *server: server instance
* UA_service_server_interpreter *service_server: server configuration, including a list of capabilities
* UA_NodeId module_type_instance_nodeId: The NodeId of the instance of the ModuleType
*/
UA_StatusCode add_capability_nodes(UA_Server *server,
UA_service_server_interpreter *service_server,
UA_NodeId moduletype_instance_nodeId);
/* Method to that sets the asset's state variable to idle
* Arguments:
* UA_Server *server: server instance
*/
UA_StatusCode write_state_variable(UA_Server *server);
/* Method to that sets the asset's registered variable to false
* Arguments:
* UA_Server *server: server instance
*/
UA_StatusCode write_registered_variable(UA_Server *server);
31 changes: 31 additions & 0 deletions _sources/queue.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
..
Copyright The Patient Zero Application Contributors
Licensed under the MIT License.
For details on the licensing terms, see the LICENSE file.
SPDX-License-Identifier: MIT
Copyright 2023-2024 (c) Fraunhofer IOSB (Author: Florian Düwel)

.. _Queue Handler:

=============
Queue Handler
=============

The open62541 server template includes a Queue Object and provides a corresponding functionality which adds or removes queue entries to the queue_variable based on tge
method calls add_queue_element and remove_queue_element. Since the queue handler operates in a separate thread, the boolean running variable
of the server's main loop has to be passed to this thread, so that it terminates when the server shuts down.

.. figure:: /images/queue.PNG
:alt: alternate textgit

.. code-block:: c
/* Arguments:
* UA_Server *server: server instance
* UA_NodeId module_object_nodeId: NodeId of the instance of the Instance of the ModuleType
* UA_Boolean *running: Pointer to the server's running variable to shut down the thread
*/
UA_StatusCode start_queue_handler(UA_Server *server,
UA_NodeId module_object_nodeId,
UA_Boolean *running);
Loading

0 comments on commit ecb57d5

Please sign in to comment.