DeleteNode in NodeManager

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

Moderator: uasdkcpp

Post Reply
MartinMajewski
Full Member
Full Member
Posts: 7
Joined: 24 Jun 2021, 17:13

DeleteNode in NodeManager

Post by MartinMajewski »

Hi there,

I have modeled my type system with UaModeler and instantiated two objects directly from it (both siblings at the top-level object folder), as it would be a pain in the bottom to do this manually (as OPC UA is!). However, I have to decide which object should be available for browsing during runtime, the other is unnecessary and has to be removed from the tree. So, I want to use the DeleteNode function or something similar from the generated myNS_NodeManager.cpp but it seems that everything needs a ServiceContext. Where to get that from? Your documentation is very sparse when it comes to using UaModeler with the C++ toolkit. Please be so kind and point me to the correct solution.

Thank you!

Best wishes,
Martin

MartinMajewski
Full Member
Full Member
Posts: 7
Joined: 24 Jun 2021, 17:13

Re: DeleteNode in NodeManager

Post by MartinMajewski »

Okay, this brought me a solution:

https://forum.unified-automation.com/viewtopic.php?f=34&t=316&p=316&hilit=deleteUaNode#p316

I think this should be part of the tutorial series or even the UaModeler tutorials and how-to section.

What's even more interesting is how to obtain the UaNodeId object coming from the UaModeler:

Code: Select all

UaNodeId id = UaNodeId(MyNsId_MyInstanciatedObject, getNameSpaceIndex());
where

Code: Select all

MyNsId_MyInstanciatedObject
is a

Code: Select all

#define
inside the
MyNs_identifiers.h
file, generated by UaModeler.

As UaModeler is using numeric identifiers, using these definitions is way more convenient - but it is poorly documented, unfortunately.

Post Reply