Login  •  Register


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 ...

Server address space to NodeSet xml export

Postby sam » 09 Jan 2019, 19:33

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.
sam
Jr. Member
Jr. Member
 
Posts: 1
Joined: 09 Jan 2019, 17:56

Re: Server address space to NodeSet xml export

Postby Support Team » 31 May 2019, 15:32

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
User avatar
Support Team
Hero Member
Hero Member
 
Posts: 2422
Joined: 18 Mar 2011, 15:09


Return to .NET based OPC UA SDK

Who is online

Users browsing this forum: No registered users and 0 guests