Will deleteUaNode delete Children recursively?
Posted: 17 Aug 2021, 11:51
Hello,
This is regarding this FAQ.
https://forum.unified-automation.com/viewtopic.php?f=34&t=316
Question:
With deleteUaNode(pNodeToDelete, OpcUa_True, OpcUa_True, OpcUa_True) with all flags set to True can delete all children recursively?
Background:
I was trying [server_lesson03] from [UaSdkCppBundleSource\examples\server_gettingstarted] with C++ based OPC UA Client Server SDK (Bundle) v1.7.4.
The following two modifications were made.
(1) Only use AIR_CONDITIONER type and did not use FURNACE type.
#define NUMBER_AIRCONDITIONER 10
#define NUMBER_FURNACES 0
(2) Only two Variables (PowerConsumption) and (State) are added and the tree will be something like below.
> Root
>> Objects
>>> BuildingAutomation
>>>>> AirConditioner_1
>>>>>> PowerConsumption
>>>>>> State
Delete folder:
UaNodeId folderNodeId("BuildingAutomation", getNameSpaceIndex());
UaNode* folderNode = getNode(folderNodeId);
if (folderNode != NULL)
{
deleteUaNode(folderNode, OpcUa_True, OpcUa_True, OpcUa_True);
folderNode->releaseReference();
folderNode = NULL;
}
Above method will delete everything including AirConditioner_1 node?
After I have tried to delete folder, it seems I still need to delete "AirConditioner_1" to re-create the same nodes.
Thank you.
This is regarding this FAQ.
https://forum.unified-automation.com/viewtopic.php?f=34&t=316
Question:
With deleteUaNode(pNodeToDelete, OpcUa_True, OpcUa_True, OpcUa_True) with all flags set to True can delete all children recursively?
Background:
I was trying [server_lesson03] from [UaSdkCppBundleSource\examples\server_gettingstarted] with C++ based OPC UA Client Server SDK (Bundle) v1.7.4.
The following two modifications were made.
(1) Only use AIR_CONDITIONER type and did not use FURNACE type.
#define NUMBER_AIRCONDITIONER 10
#define NUMBER_FURNACES 0
(2) Only two Variables (PowerConsumption) and (State) are added and the tree will be something like below.
> Root
>> Objects
>>> BuildingAutomation
>>>>> AirConditioner_1
>>>>>> PowerConsumption
>>>>>> State
Delete folder:
UaNodeId folderNodeId("BuildingAutomation", getNameSpaceIndex());
UaNode* folderNode = getNode(folderNodeId);
if (folderNode != NULL)
{
deleteUaNode(folderNode, OpcUa_True, OpcUa_True, OpcUa_True);
folderNode->releaseReference();
folderNode = NULL;
}
Above method will delete everything including AirConditioner_1 node?
After I have tried to delete folder, it seems I still need to delete "AirConditioner_1" to re-create the same nodes.
Thank you.