Basics of CAPL-----How to process received messages in CAPL

Foreword: When building a test environment, sometimes the real test nodes may not exist. In this case, it is necessary to simulate the corresponding test nodes to complete the construction of the test environment. The simulated test node also needs to respond to the test request. In this case, the corresponding message needs to be processed in the simulated test node.

Let's build a simple Case. The physical request ID is 123, the response ID is 321, and only the Test Present response is completed.

First create a new Network Node in Simulation Setup and rename it to ECU

Add the following code to Demo.can:

At the same time, add the response to the message in ECU.can

The function implemented is that when 'Q' is pressed, Test present (3E 00) will be issued. When the ECU receives the message with ID 123, and the first two bytes of the message are 3E 00, it returns 7E 00.

Press 'Q' and you can see it in the Trace window

Guess you like

Origin blog.csdn.net/WlzSnail/article/details/129165096