Custom Reference Type

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
kristianmo
Jr. Member
Jr. Member
Posts: 2
Joined: 17 Aug 2011, 14:25

Custom Reference Type

Post by kristianmo »

I have been trying to create a custom reference, HasPart. As I have understood custom references are not supported yet. While the method is not ideal I have added a reference to the SDK by pretending it is a standard OPC UA reference defined by the specification.

The steps I have done:
1) Add an identifier to opcua_identififers.h
2) Add another case to the addUaReference function in nodemanageruanode, which creates the reference.
3) Added a class and functions in uabasereferences for my custom reference which inherits from UaReference.
4) Add and identifier to opcua_browsenames.h.
5) Add the reference type to nodemanagerroot createpart5_referencetypes.
6) Add a case to checkreferencetypematch in uabasenodes.
7) Add a case to issubtypeof in uareferencetypesns0.

By doing this I can connect AirConditioner1 to Humidity in lesson02 and Humidity shows up in the address space with a HasPart reference.

1) Might there be an easier way to do this?

Thank you.
Last edited by kristianmo on 07 Feb 2013, 10:48, edited 1 time in total.

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

Re:Custom Reference Type

Post by Support Team »

Hello,

There are two problems with your solution
  • It is complicated
  • The reference type is in the wrong namespace. You are not allowed to add types to the OPC Foundation namespace
With the service release V 1.3.1 the C++ SDK will support custom reference types and the only thing you need to do is to create a reference type node. Everything else will be handled by the SDK.

The release is planned after the European IOP (Interoperability Workshop). The IOP is in two weeks.
Can you wait for this release?

Best Regards,
Unified Automation Support Team
Best regards
Unified Automation Support Team

Post Reply