# Node-red-contrib-opcua "loadAddressSpace" command

**URL:** <https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880>\
**Category:** General\
**Tags:** opcua\
**Created:** [20 December 2023 17:02 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880 "2023-12-20T17:02:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AutomationTeam-ATeam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/automationteam-ateam/32/74550_2.png) [@AutomationTeam-ATeam](https://discourse.nodered.org/u/AutomationTeam-ATeam)\
**Post date:** [20 December 2023 17:02 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/1 "2023-12-20T17:02:45Z")

</div>

Hi All,

Has anyone ever used the "loadAddressSpace" command of the "OpcUa - Server" node of the "node-red-contrib-opcua" library?  
I'm trying to create an XML of variables to load into the OPC UA server when the flow starts.  
This is so that when the flow starts I already have a correctly configured server without having to execute the "AddVariable" and "AddFolder" commands individually.

As a test I'm doing this:

1. I modify the server with the "addVariable" and "AddFolder" commands

2. Use the "saveAddressSpace" command to save the configuration I created

3. I restart node red and use the "loadAddressSpace" command to reload the previously loaded configuration

When I do this the console gives me this error:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f4e5a91573091b9a331b66862d64f44bfdab4541.png)

Can anyone tell me why and how I can solve it?

Node JS: 18.19.0  
Node Red: 3.0.2  
node-red-contrib-opcua: 0.2.320

---

<div class="post-metadata">

**Author:** ![AutomationTeam-ATeam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/automationteam-ateam/32/74550_2.png) [@AutomationTeam-ATeam](https://discourse.nodered.org/u/AutomationTeam-ATeam)\
**Post date:** [21 December 2023 11:23 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/2 "2023-12-21T11:23:29Z")

</div>

New update:

I think the problem is in the file I try to upload.  
I believe this because seeing the library code the .push() method is used  
to "add" the configuration to the already existing one.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/8/d89fe4bdf1c9006a4894af4524b57bc98c103cae.png)

Therefore the XML does not have to contain the entire server configuration but only a part.

However, I can't find an example of a "configuration piece" in XML to load. ☹

Does anyone have more experience with OPC UA or the library itself?

I hope @mikakaraila or other experts could help me

---

<div class="post-metadata">

**Author:** ![AutomationTeam-ATeam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/automationteam-ateam/32/74550_2.png) [@AutomationTeam-ATeam](https://discourse.nodered.org/u/AutomationTeam-ATeam)\
**Post date:** [10 January 2024 11:49 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/3 "2024-01-10T11:49:40Z")

</div>

Has anyone ever created an OPCUA server managed by Nodeded?

---

<div class="post-metadata">

**Author:** ![mikakaraila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikakaraila/32/37496_2.png) [@mikakaraila](https://discourse.nodered.org/u/mikakaraila)\
**Post date:** [29 January 2024 10:55 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/4 "2024-01-29T10:55:47Z")

</div>

Do not use build default address space as it will generate double variables.

---

<div class="post-metadata">

**Author:** ![AutomationTeam-ATeam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/automationteam-ateam/32/74550_2.png) [@AutomationTeam-ATeam](https://discourse.nodered.org/u/AutomationTeam-ATeam)\
**Post date:** [9 February 2024 12:00 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/5 "2024-02-09T12:00:22Z")

</div>

What should I use instead?

---

<div class="post-metadata">

**Author:** ![mikakaraila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikakaraila/32/37496_2.png) [@mikakaraila](https://discourse.nodered.org/u/mikakaraila)\
**Post date:** [15 February 2024 07:50 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/6 "2024-02-15T07:50:32Z")

</div>

Look OPCUA-TEST-NODES.json under examples. There are commands to addFolder, addVariable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 April 2024 07:51 UTC](https://discourse.nodered.org/t/node-red-contrib-opcua-loadaddressspace-command/83880/7 "2024-04-15T07:51:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
