Hi,
I used UaModeler to generate all h and cpp files with all my types, as well as an instance of those types in the objects folder. Your tutorial shows how to implement the fktSum method. Okay, I got that. But how to access variables of those instances like from the MyNs_NodeManagerBLABLA.cpp? I have retrieved the UaNode with getNode and inside the debugger, I can see, that there are all methods and variables somehow present. But how do I access them from code?
Best wishes,
Martin
How to access data of an UaModeler generated object instance?
Moderator: uasdkcpp
-
- Full Member
- Posts: 7
- Joined: 24 Jun 2021, 17:13
-
- Full Member
- Posts: 7
- Joined: 24 Jun 2021, 17:13
Re: How to access data of an UaModeler generated object instance?
Found a solution, but I don't know if it is best practice:
I would appreciate it if such short HowTos would be present in die documentation in an easily discoverable place.
Code: Select all
ChildNodeType* pChildNodeInstance = dynamic_cast<ChildNodeType*>(this->pParentNodeTypeInstance); // Parent pointer retrieved with getNode(UaNodeId) from MyNsNodeManager
pChildNodeInstance->setVariableValue(NewValue);