Bulk OPCUA Device Integration

OPUCA Device Integration

Do you have more number of OPCUA devices to register? Are you wondering how to register OPCUA devices in bulk. Then, this blog is for you!!!

This blog covers Bulk OPCUA Device Integration. Let’s jump into the topic!

yess-yes

All the information and screenshots provided in the blog is from Cumulocity version 10.14. Any version between 10.10 - 10.17 should also follow same process unless there is some breaking changes in the later versions.

Prequisites:

Java: requires 11+ version.
OPCUA Device Integration: Cumulocity should be connected to OPCUA server and ensure that the address space is visible within the server device in cumulocity.
OPCUA Deviceprotocol microservice: can be downloaded from here
Device protocol template: can be downloaded from here

Once all pre-requisites are in place, firstly, fill in the device protocol template with all the required information. Around 12 Columns needs to be filled for each datapoint that needs to be created within the device protocol. Lets go in detail of what each column represents and what are the values that needs to be filled.

Device protocol name: As the name suggests, it defines the Name of device protocol.

Tag name: It defines the path to the datapoint in server. For eg: Refer to below screenshot for clarity. If you have to configure the WS001:W_RELHUM datapoint, extract the browse name of it and its parents upto THEGEAR node. And concatenate all the browse names starting with the top parent separating with ‘;’. In this case path is 2:THEGEAR;2:Port(9);2:WS001;2:WS001:W_RELHUM

image

Data type: It defines what kind of datapoint or variable you need to create in cumulocity. There are 3 types of data type: measurement, alarm, event. Select one of the 3 data types.

Type: It defines the type of the datapoint that needs to be created in cumulocity.

Text: The value of this property is defined on the selected Data type column.
If measurement is selected, then this property defines the fragment of the measurement. - Mandatory
If event is selected, then this property has no effect. So, it can be left blank.
if alarm is selected, then this property defines the severity of the alarm. - Optional

Text2: The value of this property is defined on the selected Data type column.
If measurement is selected, then this property defines the series of the measurement. - Mandatory
If event is selected, then this property has no effect. So, it can be left blank.
if alarm is selected, then this property defines the status of the alarm. - Optional

Unit: The value of this property defines the unit of the measurement. So, it can be left blank alarm and event. - Optional

Enabled: The value of this property defines the status of the device protocol. Value can be true or false. Default value is true. If you wish to disable the device protocol, then the first entry where device protocol is defined needs to be set to false. Later entries of the device protocol values are ignored. - Optional

Server id: The value of this property defines the server device id in Cumulocity. - Mandatory

Server name: The value of this property defines the server device name in Cumulocity. - Mandatory

Subscription type: The value of this property defines the subscription type of the device in device protocol. It can be Subscription or Cyclicread. By default, its set to Subscription. - Optional

Sampling period: The value of this property defines the period for mentioned subscription type. It is in milliseconds. By default, its set to 5000. - Optional

After the file is filled with all the device protocol details, it is ready to be uploaded.

Deploy the microservice ‘OPCUA Deviceprotocol microservice’ to the tenant and subscribe it.
Now the device protocol needs to be uploaded to the exposed endpoint of the service.

Endpoint details:
URL: <<tenant-url>>/service/batch-job/ntt/api/uploadDP
Method: POST
Body: file - Multipart file
      mode - create/update/delete

If the file is uploaded in create mode then all datapoints in the file are created.
If the file is uploaded in update mode then all datapoints in the file are updated.
If the file is uploaded in delete mode then all datapoints in the file are deleted.

So, be cautious about the mode we choose.

After the file is uploaded, based on the number of device protocols, it takes sometime to create device from device protocol. Once devices are created, datapoints can be verified if they are created within devices.

In the next blog, I mentioned the troubleshooting of OPCUA to my knowledge. Click here