How to re-define param type of a method from the AutoID spec

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
Jr. Member
Jr. Member
Posts: 1
Joined: 11 Aug 2020, 13:06

How to re-define param type of a method from the AutoID spec

Post by igoreq1010 »


We are using OPC UA for embedded devices based on AutoID Companion specification and created a device specific NodeSet using UAModeler.. This specification defines several standard methods to access various types of storage media, e.g. in case of RFID technology it would be ReadTag method to read out data from RFID tags.
The method ReadTag has a list of parameters, that should be given upon the method calling.

The first parameter is of type ScanData, which is a union that defines the format of the data scanned by the device. The type definition of ScanData is also part of the AutoID spec. The union refers to several data members, which are called ByteString, String and Custom to be able to represent various data formats. It can easily be deduced that there are corresponding standard types behind ByteString and String defined by the basic OPCUA specification, while Custom is intended to be defined and enhanced by the device manufacturer.
In the AutoID CS the Custom member has the abstract data type BaseDataType that can’t be used directly.
In order to create an usable Custom member with valid data type I want to re-define its definition and assign one of the standard data types, e.g. String to it.

My question is, is there a standard way to achieve this?
Right now I can only think of one possible solution:
1. Define a new union type based on ScanData with Custom member defined as a String instead of BaseDataType and give it a new type name in the device specific namespace, e.g. MyDeviceScanData.
2. Remove the existing definition of ReadTag method from the NodeSet and define a new one with the same name and param list except the first parameter – it will reference the new MyDeviceScanData instead of ScanData now.

This approach raises several questions:
- Should the “overloaded” method ReadTag be placed in the same device specific namespace as MyDeviceScanData other than AutoID namespace?
- Or new ReadTag method definition can be left in the original AutoID namespace and reference the MyDeviceData in the another namespace?
- Does this approach conform to the general concept at all or is there a different one?

Thanks in advance!

User avatar
Support Team
Hero Member
Hero Member
Posts: 2679
Joined: 18 Mar 2011, 15:09

Re: How to re-define param type of a method from the AutoID spec

Post by Support Team »


You cannot change the signatures of the standard Methods defined in the AutoId specification.

And the identifier (ScanData) passed to ReadTag is expected to match what is returned by the Scan Method.
It is expected that ReadTag just takes what Scan returns.

In ScanResult has options to provide additional information for the ScanData.
The CodeTypeDataType allows to provide additional information for the ByteString or String case.
You should NOT use ScanData.Custom if you have a String or ByteString. If you do provide a different format than the ones defined in CodeTypeDataType, you should return CUSTOM:xxx in ScanResult.CodeType.
Best regards
Unified Automation Support Team

Post Reply