OTX-Runtime for Java  
OTX-DiagManager API

The OTX DiagManager (short DiagManager) is a software component between diagnostic applications and various, interchangeable diagnostic runtime systems. The DiagManager is part of the OTX-Runtime API, but it can also be used stand-alone.

Note: The DiagManager must be started before a diagnostic communication can be established, see General Usage. The OTX-Runtime API does not start the DiagManager implicit.

Content

Overview

The picture shows the functional diagram of the software components of the DiagManager. The layers from top to bottom first contain the diagnostic application (1st layer). The diagnostic application is a process that integrates the DiagManager via the APIs (2nd layer). The APIs cover different function groups (e.g. OtxDiagApi, NoneOtxDiagApi etc.) and are available for C++, DotNet and Java. They don't have to be used at all. Each API generates commands that are transferred to the server (4th layer) via the client (3rd layer). A distinction is made between standard and non-standard commands. The structure of standard commands is the same like all diagnostic related actions and terms in OTX, e.g. GetComChannel. Non-standard commands can transport functions which are not described in OTX, e.g. ReleaseDiagService.

A client is assigned to each diagnostic application (process). There is a transport layer between client and server with interprocess communication (IPC) via SOCKETS or PIPES and alternatively without interprocess communication via direct function calls (RAW). Since the server and all layers below are in unmanaged C ++, RAW can only work together with the C ++ OTX-Runtime API. The server serializes the commands and forwards it to the CommandProcessor (5th layer). The diagnostic communication can be optimized (caching, prioritization, limitation etc.) inside the CommandProcessor. The DiagRuntimeSystem (6th layer) adapts the commands to methods of a specific diagnostic runtime system (7th layer). In addition, specific proprietary functions can be called up using non-standard commands (7th layer).

Functions

  • The DiagManager is an API for the cooperative usage of diagnostic runtime systems, based on the functionality of OTX according to ISO 13209-3 and -4
  • The DiagManager is able to optimize and prioritize diagnostic communication
  • DiagManager runs either as a separate server process for multiple applications or within the application process
  • The DiagManager is implemented in C++ and can also be used in embedded systems
  • The DiagManager APIs are available for C++, DotNet and Java
  • The DiagManager API "speaks" OTX, i.e. the methods on the API correspond to the actions and terms in OTX
  • With the DiagManager specific functions can be added via interfaces to be implemented by the user, without recompiling the DiagManager. This applies to:
    • CommandProcessor, to implement an customer specific optimization or prioritization
    • None-standardized commands, that are not standardized in OTX and which the CommandProcessor or the DiagRuntimeSystem can process
    • DiagRuntimeSystem for various MVCI implementations or proprietary diagnostic runtime systems
    • Custom implementation: If the DiagRuntimeSystem receives a special command, this is transferred together with the MCDSystem object to a custom implementation provided by the user. The implementation of the user must ensure that access to the MCDSystem object has no undesirable side effects for the DiagRuntimeSystem.
  • A parallel execution of procedures with diagnostic communication is possible via the same VCI and DoIP
  • The application is able to overwrite an existing diagnostic configuration
  • The customer is able to implement its own diagnostic runtime systems with special behavior (e.g. prioritization or optimization of diagnostic services).

APIs

The DiagManager consists of the following APIs which can be integrated into the diagnostic application. Except the OtxDiagApi all other APIs are optionally.

  • OtxDiagApi - Contains all standardized OTX commands. The commands correspond one to one to the actions and terms of the following OTX extensions:
    • BusMonitoring
    • ComInterface
    • DiagCom
    • DiagComPlus
    • DiagConfiguration
    • DiagDataBrowsing
    • DiagDataBrowsingPlus
    • EcuConfiguration
    • Flash
    • FlashPlus
    • Job
    • VehicleInfo
  • NoneOtxDiagApi - Contains all none-standardized diagnostic commands, which are not covered by OTX
  • SystemApi - Contains all system commands

Examples

1 import java.util.ArrayList;
2 
15 
16 public class OtxDiagExample {
17  public static void main(String... strings)
18  {
19  // creates a IOtxDiag instance inside a separate process with inter process communication via Sockets with port 8888
20  IOtxDiag otxdiag = OtxDiagFactory.createSocketOtxDiag(8888);
21 
22  IDiagCom diagcom = otxdiag.getDiagCom();
23 
24  // creates a comchannel
25  // identifier: LL_GatewUDS
26  // ecuVariantName: EV_GatewLear_006
27  // performVariantSelection: false
28  IComChannel comchannel = diagcom.GetComChannel("LL_GatewUDS", "EV_GatewLear_006", false);
29 
30  // creates a diagservice by short name
31  // diagservice's name: DiagnServi_ReadDataByIdentECUIdent
32  IDiagService diagservice = diagcom.CreateDiagServiceByName(comchannel, "DiagnServi_ReadDataByIdentECUIdent");
33 
34  // create a request parameter
35  // path: Param_RecorDataIdent
36  // value: "ECU Supplier Number"
37  IRequestParameter rq_Param_RecorDataIdent = DataTypeFactory.CreateRequestParameter("Param_RecorDataIdent", DataTypeFactory.CreateValue("ECU Supplier Number"));
38 
39  // creates request parameters
40  IRequestParameters RequestParameters = DataTypeFactory.CreateRequestParameters();
41  RequestParameters.add(rq_Param_RecorDataIdent);
42 
43  // create a response parameters of response Resp_ReadDataByIdentECUIdent
44  IResponseParameters rsp_Resp_ReadDataByIdentECUIdent = DataTypeFactory.CreateResponseParameters("Resp_ReadDataByIdentECUIdent");
45  IResponseParameter rsp_Param_RespoServiId = DataTypeFactory.CreateResponseParameter("Param_RespoServiId");
46  IResponseParameter rsp_Param_RecorDataIdent = DataTypeFactory.CreateResponseParameter("Param_RecorDataIdent");
47  IResponseParameter rsp_Param_MatchRecorDataIdent = DataTypeFactory.CreateResponseParameter("Param_MatchRecorDataIdent");
48  IResponseParameter rsp_Param_ECUSupplNumbe = DataTypeFactory.CreateResponseParameter("Param_DataRecor.Param_ECUSupplNumbe");
49  rsp_Resp_ReadDataByIdentECUIdent.add(rsp_Param_RespoServiId);
50  rsp_Resp_ReadDataByIdentECUIdent.add(rsp_Param_RecorDataIdent);
51  rsp_Resp_ReadDataByIdentECUIdent.add(rsp_Param_MatchRecorDataIdent);
52  rsp_Resp_ReadDataByIdentECUIdent.add(rsp_Param_ECUSupplNumbe);
53  // create response parameters
54  ArrayList<IResponseParameters> ResponseParameters = new ArrayList<IResponseParameters>();
55  ResponseParameters.add(rsp_Resp_ReadDataByIdentECUIdent);
56 
57  // execute diagservice with request/response parameters mapping
58  OutArg<OtxResultStates> resultstate = new OutArg<OtxResultStates>(OtxResultStates.ALL_INVALID);
59 
60  diagcom.ExecuteDiagService(diagservice, RequestParameters, ResponseParameters, resultstate, false, false);
61 
62  System.out.println("ResultState: " + resultstate.getValue());
63  // print response parameters mapping
64  System.out.println("Resp_ReadDataByIdentECUIdent");
65  System.out.println("\t" + "Param_RespoServiId" + "\t\t" + rsp_Param_RespoServiId.getValue().getParameterValue());
66  System.out.println("\t" + "Param_RecorDataIdent" + "\t\t" + rsp_Param_RecorDataIdent.getValue().getParameterValue());
67  System.out.println("\t" + "Param_MatchRecorDataIdent" + "\t" + rsp_Param_MatchRecorDataIdent.getValue().getParameterValue());
68  System.out.println("\t" + "Param_DataRecor");
69  System.out.println("\t\t" + "Param_ECUSupplNumbe" + "\t" + rsp_Param_ECUSupplNumbe.getValue().getParameterValue());
70  }
71 }
Factory class for creating the DataTypeFactory.
Definition: DataTypeFactory.java:11
Factory class for creating the DiagOtxApi.
Definition: OtxDiagFactory.java:14
Represents the OutArg.
Definition: opentestsystem.otxdiagmanager.otxdiagapi/src/opentestsystem/otx/diagmanager/otxdiagapi/OutArg.java:6
Identical to an enumeration in the OTX standard ISO 13209. A detailed specification can be found ther...
Definition: OtxResultStates.java:6
Identical to a datatype in the OTX standard ISO 13209. A detailed specification can be found there.
Definition: IComChannel.java:6
Identical to a datatype in the OTX standard ISO 13209. A detailed specification can be found there.
Definition: IDiagService.java:6
Identical to a datatype in the OTX standard ISO 13209. A detailed specification can be found there.
Definition: IRequestParameter.java:6
Identical to a datatype in the OTX standard ISO 13209. A detailed specification can be found there.
Definition: IRequestParameters.java:6
Identical to a datatype in the OTX standard ISO 13209. A detailed specification can be found there.
Definition: IResponseParameter.java:6
Identical to a datatype in the OTX standard ISO 13209. A detailed specification can be found there.
Definition: IResponseParameters.java:6
The class is identical to an extension in OTX standard ISO 13209. A detailed specification can be fou...
Definition: IDiagCom.java:10
The class is identical to an extension in OTX standard ISO 13209. A detailed specification can be fou...
Definition: IOtxDiag.java:8
The class is identical to an extension in OTX standard ISO 13209. A detailed specification can be fou...
Package covering all actions and terms of all diagnostic related OTX extension by an identical method...
Package containing all objects for the communication to various, interchangeable diagnostic runtime s...
Package containing all objects which are standardized according to ISO 13209 (OTX)
Package containing all objects related to testing inside automotive industry.

General Usage

Before the OTX-Runtime can communicate with a diagnostic runtime system, the DiagManager must be started. The different ways to start the DiagManager are described in Configuration. The easiest way to start the DiagManager ist to start the utility OpenTestSystem.Otx.DiagManager.Monitor.exe, see DiagManager Sample Program.

The right ODX data base must be selected and the DiagManager server must be started. In the example the server is listening at port 8888 for clients to connect.