There are multiple ways ECU diagnostics can be tested with MxSuite. Sample projects installed with MxVDev illustrate some of these approaches:
•The Diagnostics sample project shows how to use a virtual bus and built-in support for CAN-TP (ISO 15765) to send and receive diagnostic CAN messages to an MxVMC virtual ECU.
•The SIL\DiagSample project demonstrates using SIL Easy for a security algorithm, using Transport Protocol (TP) Transforms, Diagnostic Transforms, and routing data to a virtual ECU.
Before using sample projects, select Help->Copy Samples from the main menu to copy the projects to a folder of your choice. The default destination is \MxSuiteSamples under your user directory. This enables you to make changes to the sample project files.
The Diagnostics sample project shows how to utilize a virtual bus to send and receive diagnostic CAN messages to an MxVMC virtual ECU. The same strategy can be adopted for a HIL set up where a virtual bus is connected to a physical CAN bus with a real ECU. See Connecting to a Hardware Bus. The Diagnostics sample can be found in the \DiagnosticsSample subfolder. All you have to do to send and receive transport layer (ISO 15765) CAN messages is: 1.Define a message signal in the Signal Dictionary:
2.Click the Data Routing tab, set the Data Routing to CAN-TP, specify the message IDs, and select which bus the message will be transmitted on:
|
Using MxTransIt to create a Harness with multiple Transforms gives maximum flexibility for diagnostic testing: •Transport Request and Transport Response Transforms provide ISO15765 support •Tester Present Keep Alive can be sent periodically •Diagnostic Request Transform is used for building Diagnostic Requests •Diagnostic Response Transform is used for decoding responses •Security challenge response can be handled using the SIL Easy Transform: oCreate a simple C/C++ transform template oPaste in your security C/C++ code and map to the I/O ports of the Diagnostics Transform •Use Custom C# Transform / SIL Easy / VMC to handle any other functionality. The sample project in the \Sil\DiagSample\MxVDev folder demonstrates using SIL Easy for a security algorithm, using Transport Protocol (TP) transforms, Diagnostic Transforms, and routing data to a virtual ECU. Harness DetailsTransport Request and Transport Response transforms are used with transport protocol ISO15765 to send and receive data that is longer than a standard 8-byte CAN message. Transport Request breaks TP messages into standard CAN frames and Transport Response receives CAN frames and assembles the TP message. Set desired CAN Arbitration IDs in properties for proper execution. The Tester Present signal can be used to turn on and off sending of the Tester Present Keep Alive Message. Diagnostic Request and Response transforms are used to create a separate signal for any desired Diagnostic function for further customization. For example, KWP2000 Diagnostic function $10 to start Diagnostic Session can exist as its own signal ('Service $10 Req') in the TestCase, and a value passed into the transform for the desired session will build the proper CAN message to send to the ECU under test. SIL Easy transform is used to calculate the 'key' based on incoming 'seed' value. Using SIL Easy requires minimum effort to create a block that uses your existing C/C++ code. Place the transform on the graph, click 'Create New Project' in properties. Copy/Paste your code into source files or add your source files to the Visual Studio project. Harness two signals as Input and Output messages (buffers). In the example shown, a 3 byte message is used where the first byte corresponds to 'security mode' and the next two bytes store the value for seed or key. The seed value comes from Diagnostic Response to the request to send seed. When the value is received, the corresponding key is calculated and routed to the Request transforms to send the request to unlock the security mode. Funnel transforms are 'helper' transforms that are used when messages from 2 or more different sources need to be connected to one. PassThru transforms are used when signals from one source need to be sent to identical signals in sink transforms (i.e. 'MxV Module Reset') Delay transforms are used when signals from the output side of the graph need to be routed as an input to the beginning/'start' of the graph to help determine the sequence of execution. The MxVMC transform is used as an ECU under test for Software-in-the-Loop. The same approach shown in the sample can be used to test Hardware-in-the-Loop ECU when the virtual bus is connected to the hardware CAN bus.
![]() Harness for the SIL/DiagSample Project |
Transport Request/Response Transforms