问题
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