Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
If you have a diagnostic library loaded into CANoe (CDD/ODX/PDX, etc) then it will usually have the Transport Protocol defined which will segment your Tx and Rx where they are longer than 8 bytes.
Your post says that you are automating your testcases. This is done best in the test module of CANoe. If you have the CDD loaded you can drag the DID from the CAPL Browser Symbols pane (filtered by diagnostics) into the CAPL, e.g. drag "DID_01_ReadInfo" after diagRequest.
long size;
byte returnBytes[4096];
diagRequest DID_01_ReadInfo readInfoReq; // diag request object
diagResponse DID_01_ReadInfo readInfoResp; // diag reponse object
diagSendRequest(readInfoReq);
switch (testWaitForDiagResponse(readInfoReq, 2000)) // 2 sec timeout
case 0: // timeout
teststepfail("No reply from ECU");
break;
case 1: // response received
if (diaggetLastResponseCode(readInfoReq) == -1)
teststepPass("Positive Response");
// Get the number of bytes from the last response and store in 'returnBytes'
diagGetLastResponse(readInfoReq, readInfoResp);
size = diagGetPrimitiveData(readInfoResp, returnBytes, elCount(returnBytes));
teststepfail("Negative Response");
break;
Try this may be it works using SendDiagRequest(reqobj)
;
===============================================================
Add respective CDD file in vector canoe
Set target ECU in Canoe settings
You have to define contents of service each byte value, can get those values in CAN trace
create object of services in CAPL and send it using SendDiagRequest(reqobj);
–
–
–
–
fControlMessage(message 0x496 mystream)
if (0x10 == mystream.byte(0) && Abfrage == 1) //First Frame von ISO_Lenkhilfe_Resp, erstes Byte auf 0x10 überprüfen
msDiag_FlowControl.byte(0) = 0x30; // Flow Control
msDiag_FlowControl.byte(1) = 0x0F; // Block Size ist 15
msDiag_FlowControl.byte(2) = 0x00; // 20ms Abstand bei aufeinanderfolgenden Frame
RequestLenght = mystream.byte(1); // Gibt die Länge(Anzahl) der Datenbytes an
RequestLenght = RequestLenght - 6; // 6 Byte Nutzdaten abziehen
Abfrage = 0;
//write("Send first Flow Control");
output(msDiag_FlowControl);
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.