Diagnostics: Expanded Functions in CAPL
Valid for: CANoe DE As of CANoe 5.0, it is possible to access CANdela Studio diagnostic descriptions within CAPL programs:- With the configuration of the diagnostic observer, a description can be assigned to a simulation node. The CAPL program of this node is then regarded as an implementation of the diagnostic functionality of this ECU (ECU implementation) and thus all defined services are recognized.
- For the implementation of a diagnostic tester, it is possible to select the target ECU in the CAPL program, i.e., to choose the corresponding diagnostic description. This can be done either by using the CAPL function DiagSetTarget or by specifying the ECU qualifier in the definition of the diagRequest or diagResponse object.
- Request and response objects can be generated using their qualifier in combination with the respective ECU qualifier.
- In the CAPL program, diagnostic services, parameters, and parameter values can be accessed symbolically.
- The arrival of requests and responses can be processed via event procedures.
- The connection to the communication layer occurs either via the built-in diagnostic channel or via CAPL callbacks – the so-called CAPL Callback Interface (CCI) –, whereby the full control over the communication is retained for development and test. For standard applications, corresponding CCI reference implementations are already available.
- Usage in Test modules: Effective with CANoe 5.0 SP3, it is possible within test modules to wait on diagnostic events. After sending a request, you can wait for a response without programming a state machine. You have access to the response of the ECU.
Limitations
Please note the following limitations of the diagnostic functions:- Presently, a node can only implement the diagnostic functions of one ECU.
Additional Remarks
- To specify a service or simple parameter, its qualifier from the diagnostic description is used. You can drag and drop the service qualifier from the Symbol Explorer.
- In order to assign an object with a variable number of parameters, proceed as follows: if the parameter list is defined in CANdelaStudio as iterative parameters with a number, then first this parameter (e.g., “NUMBER_OF_DTC”) must be set. Then call
DiagResize(response), which makes space for the actual parameters. These can be set with theDiagSetComplexParameterfunctions.
<Qualifier Path>”. In this case, the qualifier path may be up to 255 characters in length.