opnet attribute name of opnet model is unrecognized

限于喜欢 提交于 2019-12-11 19:19:08

问题


I'm trying to simulate a network with opnet and I'm building all parts of it myself (like processors, nodes, links, ...). In my node models I use point-to-point transmitters and receivers and it all seems to be ok but when I try to run the simulation I get this error:

<<< Recoverable Error >>>
Attribute name (data rate) is unrecognized for object (0).
T (0.0001), EV (14), MOD (top.Office Network.node_1.port_tx0), KP (op_ima_obj_attr_get)

node_1 is a node and port_tx0 is its transmitter. I did not create the transmitter, I just used opnet model for it and as I can see "data rate" IS in its attributes by default and I can't even edit it. SO why doesn't it recognize its own attribute?


回答1:


In the error message the object id is 0. In my experience, this is not the correct object id for a transmitter.

To see if I am correct, please replace

op_ima_obj_attr_get(objid, "data rate", &datarate); 

with the following:

{
  char hname[128];
  char err_str[128];
  op_ima_obj_hname_get(objid, hname, 128);
  snprintf(err_str, 128, "Who is objid (%d):", objid);
  op_prg_odb_print_major(err_str, hname, OPC_NIL);
}
op_ima_obj_attr_get(objid, "data rate", &datarate);

This should answer the question "why does it not recognize its own attribute?" when run in the OPNET debugger.



来源:https://stackoverflow.com/questions/17397873/opnet-attribute-name-of-opnet-model-is-unrecognized

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!