How to obtain multiple target references|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
How to obtain multiple target references
Avatar
Kim Volz
New Member
Members
Forum Posts: 1
Member Since:
09/04/2018
sp_UserOfflineSmall Offline
1
01/03/2019 - 15:06
sp_Permalink sp_Print

I'm trying to get all target references of a node:
System
  |
  --> Base
         |
         --> ProcMod
         |
         --> Relay

UaReferenceLists* pMyList = pBaseObj->getUaReferenceLists();

// Get the SOURCE pointer - This Works!!!
UaNode* pS1 = pMyList->pSourceNodes()->pSourceNode();
OpcUa_UInt32 s1Id = pS1->nodeId().identifierNumeric();
OpcUa_UInt32 sysId = pSysObj->nodeId().identifierNumeric();
if (s1Id == sysId)
      cout << "you have figure this out1" << endl;//<--- hits This line of code

// I did NOT expect this to work. However, when I look in the debugger,
// I don't see any way to get to the First node (ProcMod)
// I only see the "LastTargetNode"
// Get the Targets information
UaNode* pT1 = pMyList->pTargetNodes()->pTargetNode();
OpcUa_UInt32 t1Id = pT1->nodeId().identifierNumeric();
OpcUa_UInt32 procId = pProcMod->nodeId().identifierNumeric();

if (t1Id == procId)
cout << "you have figure this out2" << endl;

// How do you get the first node, Nth node,
// I can figure out the "last node" 🙂

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
01/08/2019 - 04:38
sp_Permalink sp_Print sp_EditHistory

This question should posted on the Unified Automation forum since you are using their SDK.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 35
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855