Update Address space when switching between different UANodeSet XML models

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

Moderator: uasdkcpp

Post Reply
aparna22
Full Member
Full Member
Posts: 9
Joined: 03 Feb 2022, 17:38

Update Address space when switching between different UANodeSet XML models

Post by aparna22 »

Hi,

I have imported UANodeSet xml file using below functions:

addModule(UaNodeSetXmlParserUaNode(<xml file1>))
After this nodes are updated in address space and everything looks fine.

After this I am updating different UANodeSet xml file by following bellow steps:
1.UaNodeSetXmlParserUaNode(<xml file>)->shutdown() -> to remove the first UANodeSet xml configuration.
2.addModule(UaNodeSetXmlParserUaNode(<xml file2>))

In UA expert address space I can see the node information from both the UANodeSet xml files.
Shutdown() - this function doesn't delete the nodes from address space .?
If i want delete which steps i need to follow.

If any refence documentation is there kindly share it.

Thanks in advance.

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

Re: Update Address space when switching between different UANodeSet XML models

Post by Support Team »

Hello,

You should use the removeModule() method (int UaCoreServerApplication::removeModule(UaServerApplicationModule* pModule))
https://documentation.unified-automation.com/uasdkcpp/1.7.6/html/classUaCoreServerApplication.html#a2c4c49b1f4b250eee4846b4464a2aaa9

Sample code:

Code: Select all

        UaNodeSetXmlParserUaNode* pXmlParser = new UaNodeSetXmlParserUaNode(UaString("%1/Test_model.xml").arg(szAppPath), NULL, NULL, NULL);
        pServer->addModule(pXmlParser);

        pServer->removeModule(pXmlParser);
Best regards
Unified Automation Support Team

aparna22
Full Member
Full Member
Posts: 9
Joined: 03 Feb 2022, 17:38

Re: Update Address space when switching between different UANodeSet XML models

Post by aparna22 »

Hi,

Thank you for your reply.

I am using removeModule function still address space is not getting refreshed.

I tried disconnecting and connecting from UA expert, while click on connect, server is crashing (segmentation).

Any suggestions for this.

Thank You

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

Re: Update Address space when switching between different UANodeSet XML models

Post by Support Team »

Hi,

May I know which version of the C++ SDK are you using?

If you are using the latest version 1.7.6?
Can you please create a support ticket at https://webdav.unifiedautomation.com/support/support_form.html
and provide the server trace files by setting the UaStackTraceLevel=DEBUG and UaAppTraceLevel=Data in ServerConfig.xml.
Best regards
Unified Automation Support Team

aparna22
Full Member
Full Member
Posts: 9
Joined: 03 Feb 2022, 17:38

Re: Update Address space when switching between different UANodeSet XML models

Post by aparna22 »

Hi,

Using 1.7.4 version.

Sure I will create the support with the server trace files.

Thank You.

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

Re: Update Address space when switching between different UANodeSet XML models

Post by Support Team »

Hi,

Thank you for the information. This issue is a known issue in V1.7.4,
which is already fixed in C++ SDK V1.7.5. Please update the SDK, and the latest of the C++ SDK is V1.7.6.

You can see the changelog.
https://documentation.unified-automation.com/uasdkcpp/1.7.5/CHANGELOG.txt

Section: Module CoreModule (Server)
NodeManagerUaNode
- Allow to remove references for source node from other namespace.
- In destructor of NodeManagerUaNode only delete all nodes and references if the
server is not shut down.
When the server is shutdown we just delete all nodes.
- Add missing NULL pointer check if the NodeManager was not started and is shutdown.
- Add new method referenceExists. Checks if the exact same reference exists already
when adding a UaReference.
Best regards
Unified Automation Support Team

aparna22
Full Member
Full Member
Posts: 9
Joined: 03 Feb 2022, 17:38

Re: Update Address space when switching between different UANodeSet XML models

Post by aparna22 »

Hi,

Thank you for the information.

Thanks & Regards.

aparna22
Full Member
Full Member
Posts: 9
Joined: 03 Feb 2022, 17:38

Re: Update Address space when switching between different UANodeSet XML models

Post by aparna22 »

Hi,

I have updated SDK to v1.7.6. And tried below steps.

1. Server started with UANodeset file1.
2. I can see the nodes in UA expert address space.
3. Uploaded different UANodeset file2.
4. In UA expert Address space didn't get refreshed, Tried disconnecting and connecting. After this i can see address space with new nodes. (Other than removeModule() is there anything i have to do to update the address space automatically)
5. Uploaded different UANodeset file3.
6. After above step server is crashing (segmentaiton fault) at removeModule() function call. (Tried multiple times, on 3rd time model change server is crashing)

Note: At a time only one xml file i am maintaining. When different xml file is uploaded then deleting the existing xml. Before calling removeModule() new xml file will be available. will it Couse any issue.?

aparna22
Full Member
Full Member
Posts: 9
Joined: 03 Feb 2022, 17:38

Re: Update Address space when switching between different UANodeSet XML models

Post by aparna22 »

Latest observation, on calling removeModule function server is crashing in v1.7.6.

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

Re: Update Address space when switching between different UANodeSet XML models

Post by Support Team »

Hi,

I have tried by following the steps you described. However, I am not able to reproduce the issue.
Can you please open a ticket at https://webdav.unifiedautomation.com/support/support_form.html?

Please provide us the crash dump and trace files.
Best regards
Unified Automation Support Team

Post Reply