Customizing VendorServerInfoType in practice|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Customizing VendorServerInfoType in practice
Avatar
Thomas Wirtz-Baumann
Member
Members
Forum Posts: 19
Member Since:
06/02/2020
sp_UserOfflineSmall Offline
1
03/15/2024 - 07:49
sp_Permalink sp_Print

Hello,

The standard specifies the server object instance Server (i=2253) with the default child VendorServerInfo (i=2295) of type VendorServerInfoType (i=2033). In the standard, it is said that we need to create a type that inherits form VendorServerInfoType if we want to provide specific vendor information.

1) Therefore to create such custom type, we need to create a dedicated model with its own namespace. Suppose we create such model.

2) Now suppose we create a type MyCustomVendorServerInfoType in this new namespace that inherits from VendorServerInfoType (i=2033). 

3) Then we have to load this namespace in the server, say the server assigns it the index 4, and create an instance of this type MyCustomVendorServerInfoType having the same BrowseName as the instance of the original child VendorServerInfo (name="VendorServerInfo", ns=0). Since we created a new instance of MyCustomVendorServerInfoType, the node ID will have a namespace index of our node manager (say 2) and the first available identifier. Say the node ID of this instance is (ns=2;i=1).

4) Now we have to replace the existing node VendorServerInfo (i=2295) by this new one. 

The Server object instance will have then a child VendorServerInfo with:

- TypeDefinitionId = the node ID of MyCustomVendorServerInfoType 

- BrowseName = (name="VendorServerInfo", ns=0)

- NodeId = (ns=2;i=1)

And a ghost instance of VendorServerInfoType with node ID (i=2295) will be lying around but not visible. 

Question 1: Would this be the expected sequence and result?

Question 2: Shall we remove the instance node of the original VendorServerInfo (i=2295)? I'm asking this question because with the stack UA-.NETStandard it seems not possible, so probably that is not expected.

Thank you in advance for you help.

Thomas

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/15/2024 - 21:05
sp_Permalink sp_Print sp_EditHistory

The well known Node Server_VendorServerInfo  can be changed to match your Server provided the changes do not break the API.

i.e. you delete the HasTypeDefinition from i=2295 to VendorServerInfoType 

You the add a HasTypeDefinition from i=2295  to MyCustomVendorServerInfoType 

This is allowed because MyCustomVendorServerInfoType is a subtype of VendorServerInfoType .

Avatar
Thomas Wirtz-Baumann
Member
Members
Forum Posts: 19
Member Since:
06/02/2020
sp_UserOfflineSmall Offline
3
03/18/2024 - 02:54
sp_Permalink sp_Print

Thank you Randy for your feedback. 

I don't know how this should work.

  • Changing the reference dynamically does create children of MyCustomVendorServerInfoType. 
  • Call to RemoveReference of the node state VendorServerInfo for the HasTypeDefinition reference targeting ObjectTypeIds.VendorServerInfoType does not actually remove the reference.
  • I can change the reference by actually setting the TypeDefinitionId of the node state VendorServerInfo to the node ID of MyCustomVendorServerInfoType, but of course no children are created.

None of the tests I did is conclusive. How the stack is supposed to be used to replace the type of VendorServerInfo without changing the node ID of VendorServerInfo and by creating the nodes defined by the sub-type MyCustomVendorServerInfoType?

So far the only sequence this actually almost work is the one I described in the initial post above, except that the node ID VendorServerInfo is changed. 

Thank you in advance for you help.

Thomas

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
03/18/2024 - 03:24
sp_Permalink sp_Print sp_EditHistory

You are running into a limitation of the .NET SDK server framework.

I am not sure how you could do it but you may be able to delete the node and then re-add with the right type definition.

This has to happen inside the DiagnosticNodeManager.

You should raise an issue on GitHub to indicate your requirement and ask for help and/or request a feature.

https://github.com/OPCFoundati.....iscussions

That said, you can still, without violating the spec, add additional properties to the existing node without changing the type definition.

So in the short term you manually add all of your vendor specific properties to the well known instance with cross-nodemanager references.

Avatar
Thomas Wirtz-Baumann
Member
Members
Forum Posts: 19
Member Since:
06/02/2020
sp_UserOfflineSmall Offline
5
03/18/2024 - 04:50
sp_Permalink sp_Print

Ok, thank you Randy for your feedback. 

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 47
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855