I am new to OPC Server UA. I am encountering ''The type of the history values of node 'NS2|String|Data Root\Site1' can not be displayed". Could you be able to help with this type of error. Below is the code how I construct my variable node.
Code: Select all
CreateVariableSettings settings2 = new CreateVariableSettings()
{
ParentNodeId = parentNodeId,
ReferenceTypeId = ReferenceTypeIds.HasComponent,
RequestedNodeId = requestedNodeId,
BrowseName = new QualifiedName("DefinitionString", 4),
DisplayName = displayName,
DataType = DataTypeIds.String,
ValueRank = ValueRanks.Scalar,
AccessLevel = (AccessLevels.CurrentReadOrWrite | AccessLevels.HistoryReadOrWrite),
ValueType = NodeHandleType.ExternalPolled,
ValueData = new SystemAddress() { Address = blockAddress, Offset = valueOffset, NodeFullPath = fullPath },
Historizing = true,
Value = sValue
};
CreateVariable(Server.DefaultRequestContext, settings2);
lock (InMemoryNodeLock)
{
if (treeEntry.IsHistorizing())
{
SetNodeUserData(requestedNodeId, new SystemAddress()
{
Address = blockAddress,
Offset = valueOffset,
NodeFullPath = fullPath
});
NodeId configurationId = new NodeId(
editedParentNode + "." + displayName + "." +
BrowseNames.HAConfiguration,
InstanceNamespaceIndex);
parentNodeId = new NodeId(fullPath, InstanceNamespaceIndex);
// create historical configuration object.
CreateObjectSettings settings = new CreateObjectSettings()
{
ParentNodeId = parentNodeId,
ReferenceTypeId = ReferenceTypeIds.HasHistoricalConfiguration,
RequestedNodeId = configurationId,
BrowseName = BrowseNames.HAConfiguration,
TypeDefinitionId = UnifiedAutomation.UaBase.ObjectTypeIds.HistoricalDataConfigurationType,
// add optional properties.
OptionalBrowsePaths = new string[]
{
BrowseNames.StartOfArchive,
BrowseNames.StartOfOnlineArchive
}
};
CreateObject(Server.DefaultRequestContext, settings);
// Link model to node
LinkModelToNode(configurationId, treeEntry.HistoryConfiguration, null, null, 500);
}
}