Sending and Receiving XCP RAW CTO Frames

Question:

How can I send and receive XCP Raw CTO frames with CASL?

Answer:

With CASL not only diagnostic messages can be sent but also XCP CTOs. Using the standard approach also used with diagnose (using DiagRaw Messages, see example) the user can send XCP commands and access raw data of the responses. The only difference is that the respective device is an XCP device. The following example shows a short script sending a XCP command (0xFF 0x00) from CANape to the ECU and printing the first byte of the response to the write window:

int handle_tx;
int handle_rx;
handle_tx = XCPsim.DiagNewRawMessage(0xFF,0x00); //Building Tx message
handle_rx = XCPsim.DiagSendRequest(handle_tx); //Sending Tx message
//Response is received and accessible via handle_rx

Write("Output is %d", DiagGetRaw(handle_rx, 0)); //Printing first res byte



Article ID: 1291
Last updated: 2020-05-14
Revision: 5
CANape -> Measurement and Calibration of ECUs -> Sending and Receiving XCP RAW CTO Frames
https://kb.vector.com/entry/1291/