06/02/2020
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
05/30/2017
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 .
06/02/2020
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
05/30/2017
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.
1 Guest(s)