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);
  • I tried sending the DID of 5 bytes using message xxx sendMsg{dlc = 8}; output(sendMsg); this was successful. But when i tried the same with more than 8 bytes (22 bytes in my case) which uses flow control concept, Can you please explain how to implement flow control concept in CAPL? I don't have any idea about usage of DiagSendRequest(obj); – Adarsh Kale Sep 30, 2016 at 7:37 @AdarshKale To understand flow control please check the CANoe/CANalyzer documentation (e. g. online help) for ISO-TP or read this article here. – Sonic78 Jul 7, 2017 at 6:55 I tried sending the DID of 5 bytes using message xxx sendMsg{dlc = 8}; output(sendMsg); this was successful. But when i tried the same with more than 8 bytes (22 bytes in my case) which uses flow control concept, Can you please explain how to implement flow control concept in CAPL? – Adarsh Kale Sep 30, 2016 at 7:33 Although this code may help to solve the problem, it doesn't explain why and/or how it answers the question. Providing this additional context would significantly improve its long-term educational value. Please edit your answer to add explanation, including what limitations and assumptions apply. – Toby Speight Oct 4, 2016 at 15:11
    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.