OPC-UA Device Service
The Open Platform Communications - Unified Architecture (OPC-UA) Device Service provides a means of integrating OPC-UA devices with Edge Xpert. For further information about OPC-UA, refer to the OPC Foundation website.
The Edge Xpert OPC-UA Device Service is based on open62541, a well-known open-source implementation of the IEC-62541 OPC-UA standard.
Key Features
The OPC-UA Device Service supports the following key features:
- Secure and insecure connections to a remote OPC-UA Server
- Reading and writing OPC-UA nodes
- Monitored Item Service for monitoring Data Change Items and Event Items
- Browse Service capabilities
- Discovery of OPC-UA endpoints
Subscriptions
OPC-UA subscriptions allow the monitoring of nodes in a remote server.
Each connection sets up a distinct Subscription Item, which can contain one or more Monitored Items. When a Monitored Item changes on the server, the server is responsible for notifying subscribed Device Services of the change. When the OPC-UA Device Service is notified of a change, it returns the new value for the Monitored Item in a POST
command to Edge Xpert.
For further information on Monitored Items, see Add Monitored Items.
Supported Data Types
The following table lists the OPC-UA data types and their equivalent Edge Xpert data types.
OPC-UA Data Type | Edge Xpert Data Type |
---|---|
UA_Boolean | Bool |
UA_Byte | Uint8 |
UA_DateTime | Int64 |
UA_Double | Float64 |
UA_Float | Float32 |
UA_Int8 | Int8 |
UA_Int16 | Int16 |
UA_Int32 | Int32 |
UA_Int64 | Int64 |
UA_String | String |
UA_UInt16 | Uint16 |
UA_UInt32 | Uint32 |
UA_UInt64 | Uint64 |
OPC-UA Device Profile
The device profile defines what resources are available on a particular device. The following profile attributes are available:
Change in Edge Xpert v2.3
- The attribute
monitored
andpublishInterval
have been removed
Attribute | Description | Valid Values | Mandatory |
---|---|---|---|
nodeAttribute |
The node attribute that the resource is referencing | String - See the Node Attribute section for valid values | Yes, unless browseStartNodeId is defined |
nodeId |
The identifier of the node in the OPC-UA server | See NodeId | Yes, unless browseStartNodeId is defined |
dataTypeId |
The node identifier of the OPC-UA data type of the value attribute | See NodeId | No, only required if nodeAttribute equals "value" |
browseStartNodeId |
Information on the root node. Must contain the identifier, identifierType and namespace index. Note this information can also be passed to the device onboarding call via the OPC-UA RootNode protocol property |
See NodeId | No |
browsePath |
The name of a child node qualified with a namespace URI, relative to either the `browseStartNodeId` attribute | String | No, only required if browseStartNodeId is set |
browsePathNamespaceIndex |
The namespace index of the node in the OPC-UA server | A valid UInt16 value | No, only required if browseStartNodeId is set |
An example device resource can be seen below. This defines a node that is identified through the use of a dataTypeId and nodeId.
- description: A Simulated Counter
name: Counter1
isHidden: false
properties:
valueType: Uint32
readWrite: R
units: String
defaultValue: "0"
attributes:
dataTypeId:
identifier: 4
identifierType: NUMERIC
namespaceIndex: 0
nodeAttribute: value
nodeId:
identifier: Int16
identifierType: STRING
namespaceIndex: 5
browsePath
attribute instead of nodeID
, see OPC-UA Browse Service.
OPC-UA Protocol Properties
The available OPC-UA protocol properties are described in the following table:
Parameter | Type | Description | Default Value |
---|---|---|---|
Address | String |
Mandatory
The URI of the OPC-UA server in the following format: <myServerAddress>:<serverPort><endpointPath>
e.g
127.0.0.1:4840/Endpoint
|
N/A |
SecurityPolicy | String |
Optional
The security policy to be used for connecting to the OPC-UA server. Valid values are as follows:
|
None |
Username | String |
Optional
The username to be used during connection to an endpoint |
N/A |
Password | Base64-encoded String |
Optional
The password associated with the username used during connection to an endpoint |
N/A |
ApplicationUri | String |
Optional
The URI associated with any certificate used to connect to the remote OPC-UA server |
Empty |
SecurityMode | String |
Optional
The message security mode used with secure connections to the OPC-UA server Valid values are as follows:
|
None |
Certificate | String |
Optional
The name of the DER file containing the certificate to use when establishing a secure connection |
N/A |
PrivateKey | String |
Optional
The name of the DER file containing the private key to use when establishing a secure connection |
N/A |
RequestedSessionTimeout | UInt32 |
Optional
The suggested timeout, in milliseconds (ms), for inactive sessions created between the device service and an OPC-UA server endpoint |
1200000 |
SessionKeepAliveInterval | Float64 |
Optional
The interval (ms) at which the client sends requests to keep the session alive |
1000 |
RootNode | String |
Optional
The starting point for the Browse Service |
The servers root folder node |
ConnectionReadingPostDelay | UInt64 |
Optional
Delay (ms) to receiving monitored item readings after the device is added |
0 |
ReadBatchSize | UInt16 |
Optional
Default batch size for grouping read requests. This value will be used if the servers capabilities can not be accessed |
10 |
WriteBatchSize | UInt16 |
Optional
Default batch size for grouping write requests. This value will be used if the servers capabilities can not be accessed |
10 |
NodesPerBrowse | UInt16 |
Optional
Default number of nodes that are requested in a browse request. This value will be used if the servers capabilities can not be accessed |
5 |
Using the OPC-UA Device Service
For information on using the OPC-UA device service, see OPC-UA General Example and OPC-UA Security Example.