Skip to content

Overview of OPC UA protocol for MindConnect IoT2050

OPC UA data parameter

MindConnect IoT2050 connection establishment

Due to the extensive and detailed logging, system slowdowns can occur during the connection establishment phase. It depends on the work, the device has to do.

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

overview-opcua-protocol-iot2050

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 Industrial IoT. Insights Hub Monitor 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 IoT2050 the proposed limit is 10 events/alarms per second

OPC UA data point parameter

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-2050

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 Industrial IoT. 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-iot2050

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.

Last update: February 16, 2024