Integration Guide

0 mins to read


Overview

This document demonstrates the logical steps required to obtain OBD-II or J1939 fault codes from MyGeotab FaultData objects.

Logic to Derive OBD-II DTC

This section shows how to derive the OBD-II DTC (Diagnostic Trouble Code) from a FaultData object. The following FaultData object, as represented in MyGeotab SDK Runner output, will be used for illustrative purposes:

Logic to derive the OBD-II DTC from the subject FaultData object is as follows:

1

Execute a Get call to retrieve the fully-populated Diagnostic for the FaultData.Diagnostic.Id (aq0_bgE84UkqEYS3Q3W4bfQ):

2

If the Source property of the Diagnostic is either "SourceObdId" or "SourceObdSaId" (which it is in this example), continue; otherwise, abort as it will not be possible to derive an OBD-II DTC.

3

Determine the OBD-II DTC prefix using the Id of the Controller property of the Diagnostic as follows:

  1. ControllerObdPowertrainId or ControllerObdWwhPowertrainId = P
  2. ControllerObdBodyId / ControllerObdWwhBodyId = B
  3. ControllerObdChassisId / ControllerObdWwhChassisId = C
  4. ControllerObdNetworkingId / ControllerObdWwhNetworkingId = U

4

If the OBD-II DTC prefix is not one of P, B, C or U (in this example, it is P), abort as it will not be possible to derive an OBD-II DTC.

5

Convert the Diagnostic.Code (309) to hexadecimal (0135) and prepend the DTC prefix to arrive at the final OBD-II DTC (P0135).

Logic to Derive J1939 FMI and SPN

This section shows how to obtain the J1939 SPN (Suspect Parameter Number) and FMI (Failure Mode Identifier). The following FaultData object, as represented in MyGeotab SDK Runner output, will be used for illustrative purposes:

Logic to derive the J1939 FMI from the subject FaultData object is as follows:

1

Execute a Get call to retrieve the fully-populated FailureMode for the FaultData.FailureMode.Id (b2721):

2

The FailureMode.Code (2) is the J1939 FMI associated with the fault.


Logic to derive the J1939 SPN from the subject FaultData object is as follows:

1

Execute a Get call to retrieve the fully-populated Diagnostic for the FaultData.Diagnostic.Id (ave7aDNkf70qkfxoZNIGT-A):

2

If the Source property of the Diagnostic is "SourceJ1939Id" (which it is in this example), continue; otherwise, abort as it will not be possible to derive a J1939 SPN.

3

The Diagnostic.Code (3981) is the SPN associated with the fault and the Diagnostic.Name (“Cab HVAC mode control actuator”) is the SPN description.


scroll-up