You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type of Issue
[ x] Bug [ ] Enhancement [ ] Compliance [ ] Question [ ] Help wanted
The method DiagnosticsNodeManager.GetDefaultHistoryCapabilities() does not return the existing HistoryCapabilities node from the address space. Instead, it creates a new instance. There is already one there because it is part of the predefined node model for that NodeManager.
GetDefaultHistoryCapabilities() keeps a private member m_historyCapabilities. That private member is only ever initialized in that method, and it never attempts to find the existing instance in the address space.
Additionally, the HistoryServerCapabilities node that already exists in the address space is a BaseObjectState, not the derived class HistoryServerCapabilitiesState.
Also when HistoryServerCapabilities is created in GetDefaultHistoryCapabilities() it doesn't use the node ID constant that is provided with the OPC library, (Opc.Ua.ObjectIds.HistoryServerCapabilities), so the capabilities object would not be accessible using this nodeId.
What seems to be missing is to convert this node to HistoryServerCapabilitiesState in AddBehaviourToPredefinedNode(), and initialize m_historyCapabilities with that instance when it is created.
The following workaround seems to work to get the existing predefined node and update it:
var nodeHistoryServerCapabilities = FindNodeInAddressSpace(Opc.Ua.ObjectIds.HistoryServerCapabilities);
if (nodeHistoryServerCapabilities == null)
return;
var qualAHDCName = new QualifiedName("AccessHistoryDataCapability");
nodeHistoryServerCapabilities.SetChildValue(SystemContext, qualAHDCName, true, true);
This is not ideal though, since the HistoryServerCapabilitiesState class isn't able to be used.
To Reproduce
Steps to reproduce the behavior:
Add the following code to a NodeManager's CreateAddressSpace method (this code is from the sample HistoricalAccess Server):
Browse Address space to the path "Objects/Server/ServerCapabilities/" and browse the children of that node
Observe that there are 2 instances of the HistoryServerCapabilities node. One of them contains the values that were set in Step 1.
Observe that the one with uninitialized values has the node id constant value Opc.Ua.ObjectIds.HistoryServerCapabilities
Expected behavior
There should be a single instance of the HistoryServerCapabilities node, containing the specified values, and accessible using the GetDefaultHistoryCapabilities() method, or by finding it by the node id constant, Opc.Ua.ObjectIds.HistoryServerCapabilities.
Environment (please complete the following information):
OPC Package Release Version [1.4.365.23]
Component: [e.g. Opc.Ua.Core]
The text was updated successfully, but these errors were encountered:
Type of Issue
[ x] Bug [ ] Enhancement [ ] Compliance [ ] Question [ ] Help wanted
The method DiagnosticsNodeManager.GetDefaultHistoryCapabilities() does not return the existing HistoryCapabilities node from the address space. Instead, it creates a new instance. There is already one there because it is part of the predefined node model for that NodeManager.
GetDefaultHistoryCapabilities() keeps a private member m_historyCapabilities. That private member is only ever initialized in that method, and it never attempts to find the existing instance in the address space.
Additionally, the HistoryServerCapabilities node that already exists in the address space is a BaseObjectState, not the derived class HistoryServerCapabilitiesState.
Also when HistoryServerCapabilities is created in GetDefaultHistoryCapabilities() it doesn't use the node ID constant that is provided with the OPC library, (Opc.Ua.ObjectIds.HistoryServerCapabilities), so the capabilities object would not be accessible using this nodeId.
What seems to be missing is to convert this node to HistoryServerCapabilitiesState in AddBehaviourToPredefinedNode(), and initialize m_historyCapabilities with that instance when it is created.
The following workaround seems to work to get the existing predefined node and update it:
This is not ideal though, since the HistoryServerCapabilitiesState class isn't able to be used.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be a single instance of the HistoryServerCapabilities node, containing the specified values, and accessible using the GetDefaultHistoryCapabilities() method, or by finding it by the node id constant, Opc.Ua.ObjectIds.HistoryServerCapabilities.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: