Server address space to NodeSet xml export

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
sam
Jr. Member
Jr. Member
Posts: 1
Joined: 09 Jan 2019, 17:56

Server address space to NodeSet xml export

Post by sam »

Hi,
I'll have a OPC UA .NET server with a static and a dynamic part of the address space. The dynamic part could change sometimes, so I would like to export the whole address space (static and dynamic) to a Nodeset2 xml file. I was looking at the two methods "UANodeSet.Export" and "UANodeSet.Write" but the result was not satisfying.
First, there is not the right OPC UA namespace information stored in the exported NodeSet. Second, I didn't find a way to export all the nodes of an address space or all the children of a given node at one time.
Is there a way to export the whole address space of a server to a NodeSet xml file?

Thanks in advance.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Server address space to NodeSet xml export

Post by Support Team »

Hello,

the easiest way for creating a NodeSet2 XML file ist, to create an XML file per NodeManager.
You need to create a FileInfo and call UANodeSet.Export and UANOdeSet.Write.

Code: Select all

var fileOnDisk = new System.IO.FileInfo("Addressspace.xml");
UANodeSet nodeSet = new UANodeSet();
nodeSet.Export(Server.MessageContext, InMemoryNodes);
System.IO.Stream stream = fileOnDisk.Create();
nodeSet.Write(stream);
Best regards
Unified Automation Support Team

Post Reply