1.建一个新项目File->New->Project,,如图:单击“0侦',进入EnterName页面分别输入Projectname和Scenarioname,为FirstProject和first。取消UseStartupWizard.....scenario前的复选框。单击“OK”,进入主页面。2.建立包格式File->New->PacketFormat单击旦创建新包,右击编辑属性。包文件命名为“first”。如下图EaPacketFormatMyfirst_packet_formatFileEditFieldsInterfacesWindowsHelp5□序IS昌码ip(32bits)建立发送/接收节点模型五le->New->NodeModel,进入:在该页面,建立如下图模型如下:保存,File->Save。4.建立发送/接收进程模型建立如下图模型:右击st_4到st_3的链路,将condition,填写为SEND。单击“OK”Q(st_4->st_3]Attributes|i=i||回||£3|AttributeValue-name-condition-executive-color-drawingstyletr_J2SENDblacksplineRedefinePathMatch:Lookin:LExact环Names(*Substring环YaIuesLRe^Ex环PossibIevalues环TagsApplytoselectedobjectsOKICancel单击目,输入#definesend(op_intrpt_type=□pc_intrpt_self&&op_imtrpt_code=o);保存。双击st_3上半部分:输入Packet*pkptr;pkptr=op_pk_create_fmt("first");//建立一个包,参数为之间建立的包的的名称“first”op_pk_send(pkptr,0);//发送包op_intrpt_schedule_self(op_sim_time()+1,0);//设立自中断,op_sim_time()获取当前仿真的参数,后面+1
表
关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf
示,该包发送1秒之后再发送下一个包,0表示该中断的名称。保存,关闭。右击st_4到re的链路,将condition,填写为ARRIVAL。单击“OK”,单击目,输入#defineARRIVAL(op_intrpt_type()==OPC_INTRPT_STRM)/判断收到是包流保存,关闭。双击re上半部分:输入Packet*pkptr;pkptr=op_pk_get(op_intrpt_strm());//通过op_intrpt_strm()得到包op_pk_destroy(pkptr);//销毁包保存,关闭。单击Interface,将begsinintrpt设置为enabledo单击“OK”TK1hlITQVHLL11UULAttributeNameStatusInitialValuebegsimintrptsetenab1ed保存进程模型。在节点模型,右击P_0,选择EditAttributeo选择Processmodel为刚保存的进程模型。(pjD)AttributesValueAttribute-iconnameprocessor-begsimintrptenabled-docfilencLmodule-endsimintrptdisab1ed-failureintrptsdisab1ed-intrptintervaldisab1ed-priority0-recoveryintrptsdisab1ed-superprioritydisab1ed-namerece_process_11-processmodel单击OK。保存退出节点模型。分别设置SetName,为send和receiveo5.建立链路模型File->New->LinkModel选择双工类型SupportedIinktypesLinkTypeSupportedPaletteIconptsimpnuptdupyesdup_pt_1kbusbustapnu将属性closuremodel,collmodel,errormodel,eccmodel,propdelmodel,txdelmodel都设置为NONE,如果不设置在运行运行时会出错。保存,关闭。在网络模型中,单击M,查找刚保存到链路模型,在页面里面,连接send和receive。运行,结束。