Diagnostic Trouble Codes

By default, DTC requests are disabled. The only information sent by the DTC module is the MIL status (in the MDI_DTC_MIL field).
To enable DTC requests, you must apply a 0 - DTC app configuration (deactivating the safe mode).

After activation, DTCs will be written in the field MDI_CC_DTC_LIST (id 5030).
This field is a string, written in JSON format. It is an array of DTC objects, the format is described below.

Output for OBD

Example:

[
  { "dtc": "P0001", "mode": 3, "ecu": "7E8" },
  { "mdi_dtc": "C12345", "mode": 7, "ecu": "7E9" }
]

These fields are always present:

  • mode is 3 or 7 (active or pending)
    • Active trouble codes (mode 3) are codes that have been confirmed by the vehicle. They usually trigger the check engine light.
    • Pending trouble codes have been detected during the current or last driving cycle, they are waiting to be confirmed.
  • ecu is the ECU source of the DTC

These fields are present in the raw output:

  • dtc is the raw DTC code (standard or proprietary). For example P0001.
  • freeze_frame contains the raw freeze_frame contents, if applicable.

These fields are present in the transcoded output:

  • mdi_dtc as described above. The letter will be 'C' in this case.

Output for J1939

Example:

[
  { "spn": 1, "fmi": 1, "status": 1 },
  { "mdi_dtc": "T12345", "fmi": 1, "status": 0 }
]

These fields are always present:

  • fmi is the Failure Mode Indicator
  • status can be 0 (pending) or 1 (active)

These fields are present in the raw output:

  • spn is the SPN (Suspect Parameter Number) describing the DTC
  • freeze_frame contains the raw freeze_frame contents, if applicable.

These fields are present in the transcoded output:

  • mdi_dtc as described above. The letter will be 'T' in this case.

Output for J1587

Example:

[
  { "fmi": 3, "mid": 1, "pid": 1 },
  { "fmi": 3, "mid": 1, "sid": 1 }
]

These fields are always present:

  • fmi is the Failure Mode Indicator

These fields are present in the raw output:

  • mid is the Message ID. Then there is either a pid or sid field:
    • pid is the Parameter ID
    • sid is the Subsystem ID
  • There is no freeze frame in the J1587 case.

These fields are present in the transcoded output:

  • mdi_dtc as described above. The letter will be 'T' in this case.

By default, the MDI_CC_DTC_LIST field contains the raw DTC codes coming from the bus. To have access to the transcoded mode, please contact your MDI support.
In the transcoded mode, the dtc codes in the JSON are replaced with a mdi_dtc that corresponds to a specific entry in a DTC database provided by MDI. The database is composed of three files:

  • description_car.json contains all mdi_dtc codes corresponding to OBD.
  • description_truck.json contains all mdi_dtc codes corresponding to J1939.
  • description_fmi.json contains all mdi_dtc codes corresponding to J1587.

To get the DTC description, you need to take the mdi_dtc code and match it to the corresponding code in the description file.