0

how can I specify node ID in opnet by the use of op_topo_parent ?? I tried many times and the result was this error <<< Recoverable Error >>> Object ID (OPC_OBJID_INVALID) is out-of-range. T (36.4974), EV (483), MOD (top.Office Network.user.wlan_port_rx_0_0), KP (op_topo_parent) Can anyone give me a simplified example of how to use this function thanks in advance.

1 Answers1

1

op_topo_parent() needs a child object ID. Based on your error message, you want to find which node encompasses the given receiver(top.Office Network.user.wlan_port_rx_0_0). In order to get the node ID try the following code snippet.

// Get object of current Receiver object
rx_objid = op_id_self();

// Get parent, in this case node, ID
node_objid = op_topo_parent(rx_objid)

I hope this comments help you out.

Allen Kim
  • 71
  • 2
  • many thanks I solved this problem, if u identifying the node ID in the process modules so this code will be helpful. But if you need to obtain the ID in the pipeline stage for each transmitter and the receiver then you need to call it from the simulation kernal because the ID value is readable only. /*obtain source or transmitter node ID*/ source_node_objid = op_topo_parent (op_td_get_int (pkptr,OPC_TDA_RA_TX_OBJID)); note that source_node_objid has an integer value. – Neaam alsamaraie Dec 11 '15 at 19:53
  • You right. In the pipeline stage, you should use the packet's **TDA** value. – Allen Kim Dec 18 '15 at 02:10