Exec32文件夾中。然后打開(kāi)CAPL Test Module Configuration,在Components添加DoIP.dll。DoIP.vmodule 分配給應(yīng)發(fā)送診斷請(qǐng)求的節(jié)點(diǎn),并使用CAPL Callback Interface (CCI) 創(chuàng)建 DoIP 連接。DoIP.vmodule 保存在 CANoe 安裝目錄的Exec64 文件夾中。
includes{}variables{int clsTester = 1;char gECU[8] = "CCU";}void MainTest(){DoIP_SetRoutingActivationOEMSpecific(1, 0x99887777); // Set the OEM specific valuediagConnectChannel(gECU); // Connect the diagnostic channeltestWaitForDiagChannelConnected(gECU, 3000); // Wait until the channel is in state connectedtcSendRequest();}testcase tcSendRequest(){diagRequest ABS_ESP.DefaultSession_Start req;req.SendRequest();TestWaitForDiagRequestSent(req, 2000);TestWaitForDiagResponse(req, 2000);}

DoIP.vmodule 添加到測(cè)試器節(jié)點(diǎn),方法是右鍵點(diǎn)擊節(jié)點(diǎn),選擇內(nèi)容菜單Configuration... ,然后在標(biāo)簽Components 上添加 .vmodule 。.vmodule 保存在 CANoe 安裝目錄的Exec64 文件夾中。DoIP.dll 代替DoIP.vmodule。DoIP.dll 保存在 CANoe 安裝目錄的Exec32 文件夾中。然后再Components中添加DoIP.dll。includes{}variables{const cIsTester=1; // This is a testerchar gECU[20]="CCU";}void MainTest (){diagConnectChannel("CCU"); // Connect the diagnostic channeltestWaitForDiagChannelConnected("CCU",3000); // Wait until the channel is in state connectedtcSendRequest();}testcase tcSendRequest(){diagRequest ABS_ESP.DefaultSession_Start req;req.SendRequest();TestWaitForTimeout(50); // Wait for some time to avoid the test module closes the TCP channel too soon}




測(cè)量開(kāi)始后,與此配置的激活線相關(guān)的系統(tǒng)變量在 CANoe 的測(cè)量開(kāi)始時(shí)設(shè)置為1,在測(cè)量停止時(shí)設(shè)置為0 。
如果要在取消激活激活線的情況下開(kāi)始測(cè)量,可以在on start 事件程序中將此系統(tǒng)變量設(shè)置為0之后,您可以在測(cè)試期間的任何其他時(shí)間將此變量設(shè)置為1 或0 ,以便激活或取消激活線。CAPL代碼如下。
SysSetVariableInt("IO","VN5620_1::DOUT",1); // activate the Activation LineSysSetVariableInt("IO","VN5620_1::DOUT",0);// deactivate the Activation Line
如果要檢測(cè)端口是否存在,則可以通過(guò)如下操作。
t = sysGetVariableSVType(lookupSysvar("IO::VN5620_1::DOUT"));if(t==0)write("sysvar::IO::VN5620_1::DOUT does not exist");else{write("sysvar::IO::VN5620_1::DOUT is existing and will be activated");SysSetVariableInt("IO","VN5620_1::DOUT",1);}
Tcp Delayed Acknowledge activated 選項(xiàng)。
IpSetStackParameter來(lái)修改net.inet.tcp.delayed_ack的參數(shù)值為0即可,另外CANoe中默認(rèn)的TCP ACK延遲時(shí)間是100 ms,若想修改延遲時(shí)間,可以使用函數(shù)IpSetStackParameter來(lái)修改net.inet.tcp.delacktime的參數(shù)值。
-end-
分享不易,懇請(qǐng)點(diǎn)個(gè)【??】和【在看】