Diagnostic Request/Response

Diagnostic_ReqResp

The Diagnostic Request Transform encodes a Diagnostic Service Request into a Diagnostic Message. The Diagnostic Response Transform decodes the response. Source code is available from Danlaw.

These Transforms are usually used in conjunction with the Transport Request and Response Transforms.

Use with Transport Transforms

The Diagnostic Request and Response Transforms are helper Transforms that can be placed upstream/downstream of TP transforms. They are used to build diagnostic messages.

If you only have TP transforms, there are 2 messages to control in the TestCases: Transport RQ Msg (transmit) and Transport RS Msg (receive). With the Diagnostic Request/Response Transforms, you can have any number of messages in the TestCase. Essentially they give you more Signals to work with and possibly assign separate pass/fail criteria.

The way it works is that the Diagnostic Request/Response Transforms add or subtract a byte to the message. Here is example using the ‘Service $10 Req’ Signal on the Diagnostic Request Transform:

In the TestCase, add a 1-byte transition, ‘0x01’, to the ‘Service $10 Req’ Signal. The Diagnostic Request Transform appends its service byte and creates a 2-byte transition, ‘0x10 0x01’, which it transmits to the Transport Request (TR) Transform.  The TR Transform builds a proper CAN message and sends it out on the bus, where it looks like ‘02 10 01 00 00 00 00 00

So, ‘01’ -> ‘10 01’ -> ‘02 10 01 00 00 00 00 00’

The ECU might respond with ‘02 50 00 00 00 00 00 00’. Then the Response Transforms work in reverse. Transport Response processes the message and sends ’50 00’ on its response port. The Diagnostic Response Transform receives this and sends ‘00’ on its port, ‘Service $50 Rsp’.

So, ‘02 50 00 00 00 00 00 00’ -> ’50 00’ -> ‘00’

If these two Signals are in the TestCase, ‘Service $10 Req’ and ‘Service $50 Rsp’, the result is ‘01’ on the stimulus transition, and ‘00’ on the response transition.

When the ECU sends a 1-byte response, there is a 0-byte (empty) message on the Diagnostic Response Transform.

Harness for the SIL/DiagSample Project

Harness for the SIL/DiagSample Project

 

Related Topics:

Transport Request/Response

Diagnostics Testing

Sample Projects–Sil/DiagSample