When a diagnostic tool is connected to the server it gets the the DTC.
I want to know how the DTC data is defined and stored in the ECU.
DTC codes are usually defined as 2-byte or 3-byte values.
A common representation following ISO 15031-6/SAE J2012 is as five-character alphanumeric code (ie. P0001
) with the optional low-byte appended as hexadecimal value (ie. P0001-00
). The first letter being either: P for Powertrain (00b
, highest bits on highest byte), C for Chassis (01b
), B for Body (10b
) or U for Network related DTCs (11b
). ie.
P0001
(Fuel Volume Regulator Control Circuit/Open) would be represented as bytes: 0x00 0x01
P0A01
(Range/Performance) would be represented as bytes: 0x0A 0x01
C0001
(TCS Control Channel A Valve 1) would be represented as bytes: 0x40 0x01
The DTCs are stored as their respective byte representation in Non-volatile memory (NvM) of the ECU, so that it can be retrieved even if the ECU has been power cycled. Along with the DTC additional information will be stored, i.e. Freeze frame/environmental data, DTC status mask (pendingDTC/confirmedDTC/...), counter (aging/debouncing), time of first occurence, etc.