|
@@ -9,62 +9,63 @@ events (such as data changes) can be negotiated with the server. The client/serv
|
|
|
mapped either to a binary encoding and TCP-based transmission or to SOAP-based webservices. As of
|
|
|
late, OPC UA is marketed as the one standard for non-realtime industrial communication.
|
|
|
|
|
|
-We believe that it is best to understand OPC UA *from the inside out*, building upon conceptually
|
|
|
+We believe that it is best to understand OPC UA <em>from the inside out</em>, building upon conceptually
|
|
|
simple first principles. After establishing a first understanding, we go on explaining how these
|
|
|
-principles are realized in detail. Examples are given based on the *open62541* implementation of the
|
|
|
+principles are realized in detail. Examples are given based on the </em>open62541</em> implementation of the
|
|
|
standard.
|
|
|
|
|
|
-OPC UA, a collection of services
|
|
|
---------------------------------
|
|
|
+<h2>OPC UA, a collection of services</h2>
|
|
|
|
|
|
In OPC-UA, all communication is based on service calls, each consisting of a request and a response
|
|
|
message. Be careful to note the difference between services and methods. Services are pre-defined in
|
|
|
-the standard and cannot be changed. But you can use the *Call* service to invoke user-defined
|
|
|
+the standard and cannot be changed. But you can use the <em>Call</em> service to invoke user-defined
|
|
|
methods on the server.
|
|
|
|
|
|
For completeness, the following tables contain all services defined in the standard. Do not bother
|
|
|
with their details, yet. We will introduce the different services later in the text. In open62541,
|
|
|
each service is implemented in a single function. See the \ref services section for details.
|
|
|
|
|
|
-__Establishing communication__
|
|
|
+<bf>Establishing communication</bf>
|
|
|
|
|
|
-| Discovery Service Set | SecureChannel Service Set | Session Service Set |
|
|
|
-|-----------------------|---------------------------|---------------------|
|
|
|
-| FindServers | OpenSecureChannel | CreateSession |
|
|
|
-| GetEndpoints | CloseSecureChannel | ActivateSession |
|
|
|
-| RegisterServer | | CloseSession |
|
|
|
-| | | Cancel |
|
|
|
-
|
|
|
-__Interaction with the information model__
|
|
|
+<table>
|
|
|
+<tr> <th>Discovery Service Set </th><th>SecureChannel Service Set </th><th>Session Service Set </th></tr>
|
|
|
+<tr> <td>FindServers </td><td>OpenSecureChannel </td><td>CreateSession </td></tr>
|
|
|
+<tr> <td>GetEndpoints </td><td>CloseSecureChannel </td><td>ActivateSession </td></tr>
|
|
|
+<tr> <td>RegisterServer </td><td></td><td>CloseSession </td></tr>
|
|
|
+<tr> <td></td><td></td><td>Cancel </td></tr>
|
|
|
+</table>
|
|
|
|
|
|
-| NodeManagement Service Set | View Service Set | Query Service Set | Attribute Service Set | Method Service Set |
|
|
|
-|----------------------------|--------------------------------|-------------------|-----------------------|--------------------|
|
|
|
-| AddNodes | Browse | QueryFirst | Read | Call |
|
|
|
-| AddReferences | BrowseNext | QueryNext | HistoryRead | |
|
|
|
-| DeleteNodes | TranslateBrowsePathsToNodeIds | | Write | |
|
|
|
-| DeleteReferences | RegisterNodes | | HistoryUpdate | |
|
|
|
-| | UnregisterNodes | | | |
|
|
|
+<bf>Interaction with the information model</bf>
|
|
|
|
|
|
-__Notifications__
|
|
|
+<table>
|
|
|
+<tr> <th>NodeManagement Service Set </th><th>View Service Set </th><th>Query Service Set </th><th>Attribute Service Set </th><th>Method Service Set </th></tr>
|
|
|
+<tr> <td>AddNodes </td><td>Browse </td><td>QueryFirst </td><td>Read </td><td>Call </td></tr>
|
|
|
+<tr> <td>AddReferences </td><td>BrowseNext </td><td>QueryNext </td><td>HistoryRead </td><td></td></tr>
|
|
|
+<tr> <td>DeleteNodes </td><td>TranslateBrowsePathsToNodeIds </td><td></td><td>Write </td><td></td></tr>
|
|
|
+<tr> <td>DeleteReferences </td><td>RegisterNodes </td><td></td><td>HistoryUpdate </td><td></td></tr>
|
|
|
+<tr> <td></td><td>UnregisterNodes </td><td></td><td></td><td></td></tr>
|
|
|
+</table>
|
|
|
|
|
|
-| MonitoredItem Service Set | Subscription Service Set |
|
|
|
-|---------------------------|--------------------------|
|
|
|
-| CreateMonitoredItems | CreateSubscription |
|
|
|
-| ModifyMonitoredItems | ModifySubscription |
|
|
|
-| SetMonitoringMode | SetPublishingMode |
|
|
|
-| SetTriggering | Publish |
|
|
|
-| DeleteMonitoredItems | Republish |
|
|
|
-| | TransferSubscription |
|
|
|
-| | DeleteSubscription |
|
|
|
+<bf>Notifications</bf>
|
|
|
|
|
|
+<table>
|
|
|
+<tr> <th>MonitoredItem Service Set </th><th>Subscription Service Set </th></tr>
|
|
|
+<tr> <td>CreateMonitoredItems </td><td>CreateSubscription </td></tr>
|
|
|
+<tr> <td>ModifyMonitoredItems </td><td>ModifySubscription </td></tr>
|
|
|
+<tr> <td>SetMonitoringMode </td><td>SetPublishingMode </td></tr>
|
|
|
+<tr> <td>SetTriggering </td><td>Publish </td></tr>
|
|
|
+<tr> <td>DeleteMonitoredItems </td><td>Republish </td></tr>
|
|
|
+<tr> <td></td><td>TransferSubscription </td></tr>
|
|
|
+<tr> <td></td><td>DeleteSubscription </td></tr>
|
|
|
+</table>
|
|
|
|
|
|
OPC UA, a web of nodes
|
|
|
----------------------
|
|
|
|
|
|
The information model in each OPC UA server is a web of interconnected nodes. There are eight
|
|
|
different types of nodes. Depending on its type, every node contains different attributes. Some
|
|
|
-attributes, such as the *NodeId* (unique identifier) and the *BrowseName*, are contained in all node
|
|
|
-types.
|
|
|
+attributes, such as the <em>NodeId</em> (unique identifier) and the <em>BrowseName</em>, are
|
|
|
+contained in all node types.
|
|
|
|
|
|
<table>
|
|
|
<tr> <td>ReferenceTypeNode</td> <td>MethodNode</td> </tr>
|
|
@@ -73,8 +74,8 @@ types.
|
|
|
<tr> <td>VariableNode</td> <td>ViewNode</td> </tr>
|
|
|
</table>
|
|
|
|
|
|
-Nodes are interconnected by directed reference-triples of the form `(nodeid, referencetype,
|
|
|
-target-nodeid)`. Therefore an OPC UA information model is easiest imagined as a __web of nodes__.
|
|
|
+Nodes are interconnected by directed reference-triples of the form <dfn>(nodeid, referencetype,
|
|
|
+target-nodeid)</dfn>. Therefore an OPC UA information model is easiest imagined as a <em>web of nodes</em>.
|
|
|
Reference types can be
|
|
|
- standard- or user-defined and
|
|
|
- either non-hierarchical (e.g., indicating the type of a variable-node) or hierarchical (e.g., indicating a parent-child relationship).
|
|
@@ -83,8 +84,8 @@ Reference types can be
|
|
|
OPC UA, a protocol
|
|
|
------------------
|
|
|
|
|
|
-The OPC UA protocol (both binary and XML-based) is based on 25 *built-in* datatypes. In open62541, these
|
|
|
-are defined in ua_types.h.
|
|
|
+The OPC UA protocol (both binary and XML-based) is based on 25 <em>built-in</em> datatypes. In
|
|
|
+open62541, these are defined in ua_types.h.
|
|
|
|
|
|
<table>
|
|
|
<tr> <td>Boolean</td> <td>Float</td> <td>StatusCode</td> </tr>
|
|
@@ -100,7 +101,7 @@ are defined in ua_types.h.
|
|
|
|
|
|
The builtin datatypes are combined to more complex structures. When the structure contains an array,
|
|
|
then the size of the array is stored in an Int32 value just before the array itself. A size of -1
|
|
|
-indicates an undefined array. Positive size (and zero) have the usual semantics.
|
|
|
+indicates an undefined array. Positive sizes (and zero) have the usual semantics.
|
|
|
|
|
|
Most importantly, every service has a request and a response message defined as such a data
|
|
|
structure. Their exact definitions can be looked up here:
|