capluds

How can we check the response of UDS message through CAPL?


I have written a basic program to send a UDS message in CAPL, But I don't know how to take the response inside the testcase function.

Below is the code snippet

includes
{
  
}

variables
{
    message 0x639 read;
}

void maintest()
{
    tc1();
}

testCase tc1()
{
    read.dlc=0x08;
    read.byte(0)=0X02;
    read.byte(1)=0x10;
    read.byte(2)=0x03;
    output(read);
    testStepPass("OK");
}

Solution

  • As mentioned in the previous comments, it is recommended to use the Diagnostic Features.

    If you wish to use raw frames, then there is a function for waiting for the response message.

    TestWaitForMessage(0x649,100);
    TestGetWaitEventMsgData(res_msg);
    

    The res_msg will be having the byte values of the response.
    You can access it by res_msg.byte(0).