diff --git a/bindings/protocols/opcua/index.html b/bindings/protocols/opcua/index.html new file mode 100644 index 00000000..3f0bac0e --- /dev/null +++ b/bindings/protocols/opcua/index.html @@ -0,0 +1,396 @@ + + +
+ + + +This document describes how to map the OPCUA protocol to the W3C Web of Things.
++ + This document is a work in progress +
++ 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"
+Protocol | +Description | +Reference | +
---|---|---|
opc.tcp | +
+ + OPC UA over TCP + + |
+ OPC UA over TCP | +
opcua+uacp | +OPC UA over WebSocket with binary encoding | ++ OPC UA over WebSockets + | +
opcua+uajson | +OPC UA over WebSocket with JSON encoding | ++ OPC UA over WebSockets + | +
TODO: Introduce briefly the vocabulary
++ TODO: Describe the allowed terms in a form that use this binding. Provide the terms using the table structure +
+Vocabulary term | +Description | +Assignment | +Type | +
---|---|---|---|
opcua:nodeId |
+ refers to a node in the server address space to read write or subscribe to | +mandatory | +string | +
opcua:method |
+ refers to a node in the server address space that indicates the method to call during an action | +mandatory | +string | +
A opcua:nodeId could be provided using different format: string, nodeId, or browse path.
+ns=<namespaceIndex>;<type>=<value>
where:
+<namespaceIndex>
is a numeric value representing the index of the corresponding
+ namespace in the namespace array of the server.
+ ns=<namespaceIndex>;
can be omitted if the namespace is the default namespace.
+ <type>
is either i,s,g, or b
+ <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\"" | +
+ see reference to NodeId definition in the opcua reference + + https://reference.opcfoundation.org/v104/Core/docs/Part6/5.2.2/#Table5 +
++ 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 Path | +Description | +
---|---|
“/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. + | +
Value | +Description | +
---|
Map WoT Interaction model verbs to default values if any
+Operation | +Default Biding | +
---|---|
readproperty |
+
+
+ Read
+
+ |
+
writeproperty |
+
+ Write
+
+ |
+
subscribe |
+
+
+ CreateMonitoredItems
+
+ |
+
+ 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. +
++ the OPCUA-JSON codec payload format follow the OPCUA JSON data encoding format defined in + reference.opcfoundation.org/Core/docs/Part6/5.4.1 +
+ ++{ + "@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" }, + }, + ], + }, + } +} ++