opc-uahistorian

TranslateBrowsePathsToNodeIds() OPC-UA method with Simatic ProcessHistorian


I'm trying to call TranslateBrowsePathsToNodeIds method (defined on View Service Set of OPC-UA standard) using OPC-UA client against Simatic ProcessHistorian (Simatic PCS 7 version 8.1).

When I browse the server with Sample Client from UA-.NET I can see two nodes under Objects root:

For Server node the method works fine but I can't figure out a way how to get nodes down the tree starting from Process Historian {7a3ea44f-b495-414c-84f9-7498095d43bd} (which is actually the data model).

The code looks like this (C#):

var startNodeId = new NodeId(Objects.ObjectsFolder);
var browsePaths = new BrowsePathCollection
{
    new BrowsePath
    {
        RelativePath = RelativePath.Parse(relativePath, session.TypeTree, session.NamespaceUris, session.NamespaceUris),
        StartingNode = startNodeId
    }
};

var responseHeader = session.TranslateBrowsePathsToNodeIds(
    null,
    browsePaths,
    out var results,
    out var diagnosticInfos);

The resulting StatusCode is BadNoMatch.

The relativePath parameter is 3:Process Historian {7a3ea44f-b495-414c-84f9-7498095d43bd} (the value which Sample Client displays as BrowseName for that node). I tried also without 3: namespaceId prefix with no difference.

If I try to use NodeId of the Process Historian {7a3ea44f-b495-414c-84f9-7498095d43bd} node as the startNodeId parameter, the resulting StatusCode is BadNodeIdUnknown.

The same code works well with other OPC-UA servers like KEPServerEX or Aspen InfoPlus21. I'm not sure if the code should be different or if ProcessHistorian just does not support it. Any help appreciated.

EDIT: As @AndrewCullen pointed out there are few ways how to get the RelativePath instance. I examined the code in UA-.NET and tried also creating RelativePath using its constructor, which controls every aspect of the object:

var qn = new QualifiedName("Process Historian {7a3ea44f-b495-414c-84f9-7498095d43bd}", 3);
var rp = new RelativePath(null, false, true, qn);

browsePaths.AddRange(relativePaths.Select(relativePath => new BrowsePath
{
    RelativePath = rp,
    StartingNode = startNodeId
}));

According to OPC UA Part 04 - Services (chapter 7.26) when the referenceTypeId is not specified (the first argument of the RelativePath's constructor) then all References are included and the parameter includeSubtypes is ignored. So this construct should be the most universal (if I understand it correctly). But neither this approach was successful.

EDIT2:

Attaching View Node Attributes for Process Historian node:

View Node Attributes for Process Historian node

And what I actually need is to translate Browse Path for tags. Attributes of one sample tag follows in the next picture.

So I would need to resolve path like: 3:Process Historian {7a3ea44f-b495-414c-84f9-7498095d43bd}/3:CMC/3:OSS1/3:OSS1_OSS1/3:ZAKLADAC/POC_VRSTEV.V to its NodeId. There might be another catch - the slash in the name - do I need to escape it somehow?

Tag attributes

Edit3:

Also filed as issue at GitHub of OPCFoundation


Solution

  • So the final result is that Proces Historian DOES NOT SUPPORT TranslateBrowsePathsToNodeIds (despite of it works for the Server node).

    In the end I found documentation (ch 3.9.5) that the Process Historian supports only following functionality from View Service Set:

    which conforms to the View Basic ConformanceUnit of View Services, detailed in OPC UA Part 7: Profiles