Skip to content

Overview of OPC UA protocol for MindConnect Software Agent

OPC UA datasource parameter

The following image shows the data source input window for the OPC UA protocol:

overview-opcua-protocol-mcsa

For the OPCUA protocol, the data source input supports the following parameters:

Parameter Description
Protocol Shows the selected protocol type
Name Name of the data source
Description Add a description for data source
Reading Cycle Enter a reading cycle for the data source
OPC UA Server Name Enter the name of the OPC UA Server Name
OPC UA Server Address Enter the OPC UA Server Address
OPC UA Server IP Address Enter the OPC UA Server IP Address
OPC UA Authentication Type You can choose between the following types:
- NONE: No authentication enabled
- BASIC: Enables the OPC UA BASIC authentication
OPC UA Security Mode You can choose between the following modes:
- NONE: No security mode
- CERTIFICATE: Enables to upload a certificate in the following formats: *.pfx, *.pf12, *.cer, *.crt, *.der, *.p7b, *.p7r, *.spc
Enable OPC UA Events You can enable the transfer and takeover of events and alarms in the OPC UA protocol to Insights Hub. Operation Insight shows all events and alarms in the "Events" extension of the agent asset.
Limits:
- For Nanobox the proposed limit is 25 events/alarms per second
- For IoT2040 the proposed limit is 10 events/alarms per second

OPC UA data point parameter

In order to collect the data of the OPCUA device, click "Add Datapoint" to add new datapoint.

The following image shows the data point parameter window:

s7-data-point-parameter-mcsa

OPC UA Data Access Specification

OPC UA Data Access Specification does not specify a certain representation for OPC UA Addresses (NodeId). A NodeId is represented by a combination of:

  • NamespaceIndex
  • IdentifierType
  • Identifier

OPC UA Client Driver addresses have the following syntax: ns=;=.

Note

OPC browsing is not supported.

For more information refer to the table below:

Field Description
NamespaceIndex The index of the OPC UA Server namespace in which the address resides. If the index is 0, the entire ns=;= clause is omitted.
IdentifierType The type of address. OPC UA supports the following four address types:
i: A numeric address represented with 32-bit unsigned integer
s: A string address containing characters that can be encoded using UTF-8
g: A GUID address in the format of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
b: An opaque address (such as a byte string)
Identifier The address that is formatted as a string. This address may be numeric, string, GUID, or opaque.

Examples NodeId

Below you can see examples of an OPC UA Addresses (NodeId) representation:

String:

String IdentifierType Example
ns=[id];s=[string] ns=5;s=Counter1
Attribute NodeId Value NodeId
NamespaceIndex 5
IdentifierType String
Identifier Counter1

String for Identifier

The string you enter at the four Identifier will be case sensitive.

Numeric:

Numeric IdentifierType Example
ns=[id];i=[number] ns=0;i=3190 OR
Attribute NodeId Value NodeId
NamespaceIndex 0
IdentifierType Numeric
Identifier 3190 [BaseEventType_LocalTime]

Guid:

Guid IdentifierType Example
ns=[id];g=[guid] ns=1;g=0d4e10fa-b9e1-4842-bca6-887c7d8c31f0

Base64(Opaque):

Base64(Opaque) IdentifierType Example
ns=[id];b=[base64] ns=2;b=M/RbKBsRVkePCePcx24oRA==

Datatypes Conversion

The following table shows the Datatype Conversion:

IEC61131 elementary datatypes OPC UA built-in datatypes Industrial IoT Type
BOOL Boolean boolean
SINT SByte int
USINT Byte int
INT Int16 int
UINT UInt16 int
DINT Int32 int
UDINT UInt32 int
LINT Int64 long
ULINT UInt64 long
BYTE Byte int
WORD UInt16 int
DWORD UInt32 int
LWORD UInt64 long
REAL Float double
LREAL Double double
STRING String string
CHAR Byte string
WSTRING String string
WCHAR UInt16 int
DT DATE_AND_TIME DateTime n/a
DATE DateTime n/a
TOD TIME_OF_DAY DateTime n/a
TIME Double double

Note

“NodeID“ is not a valid part of the OPC string anymore.

OPC UA Event Type

You can choose default event type or one of the custom event types created in environment.

OPC UA Event Types

OPC UA plugins supports custom event types to be uploaded to Insights Hub. Select the correct event type from the below drop-down menu, to get those events on Industrial IoT. In the dropdown menu, the events owned by the specific environment and the default event type “DataSourceEvent” is shown only.

opcuaeventypes-mcsa

The event types are summarized as below:

Data Source Event Type It is the default event type which can collect some static fields of events from OPC UA server.
Custom Event Type These types can be created by user/owner of environment, and they can collect both static and extra fields from OPC UA server.

A new event type must be created from “AgentBaseEvent” type with required extra fields and then, it can be selected from the event drop-down list which is shown during OPC UA server configuration.

Note

  • If there is no created custom event type in environment, "Data Source Event Type" will be selected by default.
  • Both, data source events and custom events will be uploaded to Industrial IoT. They can be displayed on Insights Hub Monitor regarding to their types. For more information on displaying events, refer to Introduction to Events in Insights Hub Monitor documentation.

Create custom event type via API

It is possible to create custom event types with extra fields via Event Management API. For more information on the service, see Event Management - API Overview.

Below is the api to call using a technical user /api/eventmanagement/v3/eventTypes.

The following template shows the payload of the call:

    {
      "name": "SomeCustomEventType",
      "parentId": "core.connectivity.event.type.AgentBaseEvent",
      "ttl": 35,
      "scope": "LOCAL",
      "fields": [
                  {
                    "name": "Message",
                    "filterable": false,
                    "required": false,
                    "updatable": true,
                    "type": "STRING"
                  },
                  {
                    "name": "testField1",
                    "filterable": false,
                    "required": false,
                    "updatable": true,
                    "type": "STRING"
                  },
                  {
                    "name": "testField2",
                    "filterable": false,
                    "required": false,
                    "updatable": true,
                    "type": "STRING"
                  },
                  {
                    "name": "testField3",
                    "filterable": false,
                    "required": false,
                    "updatable": true,
                    "type": "STRING"
                  }
        ]
    }

Note

  • The “name” field in body must be same as the “browseName” of the field which will be collected in the OPC UA Server. It is case-sensitive.
  • Name for "Event Type" needs to be unique
  • The “type” field must be “STRING” for all data types.
  • The “scope” field should always be given as “Local” unless a particular reason is required to make it "Public".
  • The field with name “Message” is the static field and it is not included to custom event types. It is needed to be added as an extra field.
  • The fields Time, Severity and SourceName in the Event type are reserved fields and should not be created as extra fields.

OPCUA Browsing

OPCUA browsing feature enables the browsing of nodes on an OPC server for configuring the MindConnect Elements in an automated procedure.

Limitations

  • Unsupported data types in the browsing results are listed below, the nodes with unsupported types will not be shown in the browsing result.

    • Image, ImageBMP, ImageGIF, ImageJPG, ImagePNG
    • Enumeration
    • Number
    • Structure
    • Argument
    • ByteString
    • Range
    • EuInformation
  • If the time consumption is more than 90 minutes for browsing a datasource then the operation would be cancelled by the device.

  • If the OPCUA Server has more than 150K browsable nodes under 'Root/Objects' folder, then the browsing operation will be cancelled by the device.

  • The browsing result of a datasource will expire after a day.

  • The OPCUA browsing operations are done sequentially on the device side not in parallel.

Note

  • The child of unsupported nodes type will not be shown in browsing result.
  • The device will not execute the other configuration and commanding updates made by the user via UI during browsing process.
  • If the OPCUA Server contains more than 150K browsable nodes under “Root/Objects” folder, then the browsing operation will be cancelled by the device. Some OPCUA servers contains duplication of nodes to support different OPCUA specifications therefore, the unique number of nodes to browse is limited to 150k.
  • The OPCUA browsing operations done sequentially on the device side are not in parallel. It is recommended to trigger only one operation at a time from UI and collect results before triggering a new browse operation.
  • Re-browsing needs to be triggered if the device is restarted in browsing process and the device will cancel the previous browsing task when it expires after 90mins.

Note

Multiple datasources cannot be browsed at the same time. If you try to browse multiple operation, below error message occurs.

[multiple_browsing]

Warning

Configuration jobs can only be applied after browsing operation is completed. If configuration job is applied during a browsing operation, below warning message is displayed on data source configuration page.

[Configuration_jobs]

Type Conversion

Conversions of node supported types to Industrial IoT are mentioned in below table, if the OPC Type is not included in the below table, then that would be converted to STRING.

OPC Type Cloud Type
Boolean BOOLEAN
Float DOUBLE
Double DOUBLE
Duration DOUBLE
SByte INT
Byte INT
Int16 INT
Int32 INT
Integer INT
UInt16 INT
Int64 LONG
UInt32 LONG
UInt64 STRING
String STRING
  • If the connection to OPCUA Server is disconnected during browsing, then the whole operation of browsing is failed. It is expected from the customer to trigger the browsing result again in those situations.

  • If a node with supported node type is not fulfilling the required fields on server side which is browsed than this node will be excluded, and it will not affect the whole browsing flow. The excluded node and its child nodes will not be displayed in browsing results.

  • The default type for “Acquisition type” for browse result will be READ.

Performance of OPCUA Browsing

The browsing of an OPCUA server can be a time-consuming task depending on the number of existing nodes on the server. Below table describes the time consumption for idle devices which only perform browsing operations to OPC servers.

Number of Nodes Type of Device Time Consumed
5K MindConnect Nano ~6 min
75K MindConnect Nano ~16 min
150K MindConnect Nano ~36 min

Note

The reading cycles of datasources can be affected during the OPCUA browsing operation, as it requires a huge performance activity on the MindConnect Element.


Last update: February 16, 2024