From 0cf387a077aa54b43cab0d7fff75af28ac97fd0b Mon Sep 17 00:00:00 2001 From: Etienne Rossignon Date: Sun, 10 Oct 2021 22:33:22 +0200 Subject: [PATCH 1/2] add opcua binding placeholder --- bindings/protocols/opcua/index.html | 150 ++++++++++++++++++++++++++++ index.html | 12 +++ 2 files changed, 162 insertions(+) create mode 100644 bindings/protocols/opcua/index.html diff --git a/bindings/protocols/opcua/index.html b/bindings/protocols/opcua/index.html new file mode 100644 index 00000000..48048efd --- /dev/null +++ b/bindings/protocols/opcua/index.html @@ -0,0 +1,150 @@ + + + + + + + OPCUA binding + + + +
+

This document describes how to map the OPCUA protocol to the W3C Web of Things.

+
+
+

Introduction

+

+
+
+

+ This section describes the status of this document at the time of its publication. +

+
+
+

URL format

+

TODO: Describe the URL format of the protocol binding. Provide syntax and examples.

+
+
+

OPCUA Vocabulary

+

TODO: Introduce briefly the vocabulary

+
+

Form terms

+

+ TODO: Describe the allowed terms in a form that use this binding. Provide the terms using the table structure +

+ + + + + + + + + + + + + + + + + + + + + + +
Vocabulary termDescriptionAssignmentType
opcua:nodeIdrefers to a node in the server address space to read write or subscribe tomandatorystring
opcua:methodrefers to a node in the server address space that indicates the method to call during an actionmandatorystring
+
+
+

Additional terms

+

+ Bindings may introduce domain specific concepts or data types. Add a dedicated section for each domain specific + term. If the term can have a finite set of values fill the table below to describe the possibilities. +

+ + + + + + + + + +
ValueDescription
+
+
+
+

Mappings

+ This section describes the strategies and default values to use protocol specific concepts within the + WoT Interaction model. + +
+

Default mappings

+

Map WoT Interaction model verbs to default values if any

+ + + + + + + + + + + + + + + + + + + + + +
OperationDefault Biding
readproperty + + Read + +
writeproperty + Write + +
subscribe + + CreateMonitoredItems + +
+
+
+

Possible mappings

+

+ TODO: This section should describe other mappings that can be used by TD designers. It is meant to be + informative but it provides guidelines for implementers. +

+
+
+
+

Examples

+

+ TODO: Provide a compressive list of examples about how this binding template can be used within forms or Thing + Descriptions +

+
+ + diff --git a/index.html b/index.html index e615d2f8..736c776d 100644 --- a/index.html +++ b/index.html @@ -103,6 +103,13 @@ publisher: "Modbus Organization", status: "", date: "26 April 2012" + }, + "OPC UA": { + href: "https://reference.opcfoundation.org/v104/", + title: "OPC UA Specifications", + publisher: "OPC Foundation", + status: "active", + date: "Last accessed: February 2021" } } }; @@ -258,6 +265,11 @@

Protocols

Modbus Link + + OPC UA + OPC UA + Link + From b69f38c7734b24c926814d7f70d1d5a3569e62e1 Mon Sep 17 00:00:00 2001 From: Etienne Rossignon Date: Tue, 12 Oct 2021 22:01:21 +0200 Subject: [PATCH 2/2] add opcua:nodeId description --- bindings/protocols/opcua/index.html | 260 +++++++++++++++++++++++++++- 1 file changed, 253 insertions(+), 7 deletions(-) diff --git a/bindings/protocols/opcua/index.html b/bindings/protocols/opcua/index.html index 48048efd..3f0bac0e 100644 --- a/bindings/protocols/opcua/index.html +++ b/bindings/protocols/opcua/index.html @@ -29,12 +29,55 @@

Introduction

- This section describes the status of this document at the time of its publication. + + This document is a work in progress

URL format

-

TODO: Describe the URL format of the protocol binding. Provide syntax and examples.

+ +

+ The URL format use the same syntax as per the endpoint in OPCUA. A endpoint physical address available on a network + that allows Clients to access one or more Services provided by a Server. +

+ +
opc.tcp://hostname:2655/OPC/Service
+ +

The supported protocols are "opc.tcp" and "opcua+uacp"

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ProtocolDescriptionReference
opc.tcp +

+ OPC UA over TCP +

+
OPC UA over TCP
opcua+uacpOPC UA over WebSocket with binary encoding + OPC UA over WebSockets +
opcua+uajsonOPC UA over WebSocket with JSON encoding + OPC UA over WebSockets +

OPCUA Vocabulary

@@ -69,12 +112,147 @@

Form terms

-

Additional terms

-

+

Additional terms

+ + --> +

opcua:nodeId

+

A opcua:nodeId could be provided using different format: string, nodeId, or browse path.

+
+
string form
+

ns=<namespaceIndex>;<type>=<value>

+

where:

+
    +
  • + <namespaceIndex> is a numeric value representing the index of the corresponding + namespace in the namespace array of the server. +
  • +
  • + the ns=<namespaceIndex>; can be omitted if the namespace is the default namespace. +
  • +
  • + <type> is either i,s,g, or b +
      +
    • i : NUMERIC (UInt32)
    • +
    • s : STRING (string)
    • +
    • g : GUID (Guid)
    • +
    • b : OPAQUE (ByteString)
    • +
    +
  • +
  • <value> depends on <type>
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Example
"ns=1;s=Temperature"
"i=2258"
"ns=10;i=1234"
"ns=10;s=Hello:World"
"g=09087e75-8e5e-499b-954f-f2a9603db28a"
"ns=1;b=M/RbKBsRVkePCePcx24oRA=="
"ns=1;s=\"QuotedString\""
+ The exact syntax is defined in + NodeId as string section of the OPC UA + Reference. + +

+ see reference to NodeId definition in the opcua reference + + https://reference.opcfoundation.org/v104/Core/docs/Part6/5.2.2/#Table5 +

+
+
+
browse path
+

+ A browse path is constructed of a starting node and a path. The specified starting Node identifies the node + from which the relative path is based. the path contains a sequence of +

+

+ { root: "i=84", path: "/Objects/1:MySensor/2:ParameterSet/1:Temperature"} +

+

the client will use the TranslateBrowsePathsToNodeIds service to translate the browse path to a nodeId.

+

+ The path string following the description the text format for a RelativePath specified in + BNF representation of a RelativePath +

+ The table RelativePath Examples Browse Path Description from the OPC UA Reference is reproduced below for convenience. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Browse PathDescription
“/2:Block&.Output”Follows any forward hierarchical Reference with target BrowseName = “2:Block.Output”.
“/3:Truck.0:NodeVersion” Follows any forward hierarchical Reference with target BrowseName = + “3:Truck” and from there a forward Aggregates Reference to a target with BrowseName “0:NodeVersion”.
“<1:ConnectedTo>1:Boiler/1:HeatSensor” + Follows any forward Reference with a BrowseName = + ‘1:ConnectedTo’ and finds targets with BrowseName = ‘1:Boiler’. From there follows any hierarchical + Reference and find targets with BrowseName = ‘1:HeatSensor’. +
“<1:ConnectedTo>1:Boiler/”Follows any + forward Reference with a BrowseName = ‘1:ConnectedTo’ and finds targets with BrowseName = + ‘1:Boiler’. From there it finds all targets of hierarchical References. +
“<0:HasChild>2:Wheel” + Follows any forward Reference with a BrowseName = ‘HasChild’ and qualified with the default OPC UA + namespace. Then find targets with BrowseName = ‘Wheel’ qualified with namespace index ‘2’. +
“<!HasChild>Truck” + Follows any inverse Reference with a BrowseName = ‘HasChild’. Then find targets with BrowseName = + ‘Truck’. In both cases, the namespace component of the BrowseName is assumed to be 0. “<0:HasChild>” + Finds all targets of forward References with a BrowseName = ‘HasChild’ and qualified with the + default OPC UA namespace. +
+
@@ -139,12 +317,80 @@

Possible mappings

+
+

Codec

+

+ the OPCUA-JSON codec payload format follow the OPCUA JSON data encoding format defined in + reference.opcfoundation.org/Core/docs/Part6/5.4.1 +

+

+
+

Examples

-

+ +

+{
+    "@context": "https://www.w3.org/2019/wot/td/v1",
+    "@type": ["Thing"],
+
+    securityDefinitions: { nosec_sc: { scheme: "nosec" } },
+    security: "nosec_sc",
+
+    title: "servient",
+    description: "node-wot CLI Servient",
+
+    opcua: {
+        namespace: [
+            "http://opcfoundation.org/UA", 
+            "own", 
+            "http://opcfoundation.org/UA/DI/"
+        ]
+    },
+    base: "opc.tcp://localhost:26543",
+    properties: {
+        Temperature: {
+            description: "the temperature in the room",
+            observable: true,
+            readOnly: true,
+            unit: "°C",
+            "opcua:nodeId": { root: "i=84", path: "/Objects/1:MySensor/2:ParameterSet/1:Temperature" },
+            forms: [
+                {
+                    type: "object",
+                    href: "", // endpoint,
+                    op: ["readproperty", "observeproperty"],
+                },
+                {
+                    type: "number",
+                    href: "", // endpoint,
+                    op: ["writeproperty"],
+                },
+            ],
+        },
+        TemperatureSetPoint: {
+            description: "the temperature set point",
+            observable: true,
+            readOnly: false,
+            unit: "°C",
+            forms: [
+                {
+                    type: "object",
+                    href: endpoint,
+                    op: ["readproperty", "observeproperty", "writeproperty"],
+                    "opcua:nodeId": { root: "i=84", path: "/Objects/1:MySensor/2:ParameterSet/1:TemperatureSetPoint" },
+                },
+            ],
+        },
+    }
+}
+