Jump to content

Test-AC: Difference between revisions

From Teltonika Telematics Wiki
No edit summary
GTPGTM-11768 - draft
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
=RTK Coordinate via CAN Integration with FMC650=
==Introduction==
==Overview==
Activating '''RTK (Real-Time Kinematic)''' coordinate acquisition enables the FMC650 device to process RTK data from CAN.
When configured, the RTK module can provide high-precision coordinates using: 
*RTK receiver via RS232 
*RTK data via CAN 
*Internal GNSS receiver (GNS) as fallback 
The device automatically chooses the best available source based on configuration and data quality. 


The following specifications indicate the minimum firmware and configurator version requirement to use RTK coordinate acquisition via CAN on FMC650.
With a professional device lineup, telltale information (dashboard indicators) from heavy-duty vehicles can be read remotely to identify a variety of issues. New feature of Diagnostic Trouble Code (DTC) reading will help to narrow down the specific faults happening in vehicles.  


*<b>Platform:</b> FM65 
With {{{model}}} you can read 2 types of DTC messages based on J1939 protocol:  
*<b>Device:</b> FMC650 
*<b>Firmware version:</b> 03.01.03.Rev.227 
*<b>Configurator version:</b> B.FMX6_R.192 


==Method of Operation==
*DM1 – Communicates currently present faults
When the RTK option is enabled, the device always tries to use RTK sources first and falls back to internal GNSS if needed. 
*DM2 – Reports stored faults


'''Source priority'''
{{{model}}} is able to read DM codes and pass them to the server in IO element. When active DM1 or DM2 messages appear on CAN line it is broadcasted very often – {{{model}}} device saves the codes into the internal memory and does not flood the server with irrelevant information – only new DTC codes are sent to the server.
#'''RS232 (primary RTK source)'''
#:*The device checks whether any COM port (COM1 or COM2) is configured in RTK mode.
#:*If at least one COM port is configured for RTK and valid data is present, coordinates are taken from RS232. 
#'''CAN RTK (secondary RTK source)'''
#:*If RS232 RTK data is not available or is invalid, the device checks the CAN RTK status. 
#:*If valid CAN RTK data is available, coordinates are taken from CAN. 
#:*A timing check is applied if the time difference between received CAN RTK frames is greater than 2 seconds. The device automatically switches to the internal GNSS receiver (GNS) to keep coordinates up to date.
#'''Internal GNSS (GNS) Fallback'''
#:*If neither RS232 nor CAN provide valid RTK data, the device uses the internal GNSS receiver (GNS) for coordinates. 
#'''RTK Disabled'''
#:*If the RTK option is disabled, coordinates are always taken from the internal GNSS receiver.  


'''RTK data from CAN'''
==Functionality Description==


When CAN is used as the RTK source, the device reads: 
This functionality is available from Firmware version '''03.01.02.rev.06''' or higher.
*'''Latitude''' 
*'''Longitude''' 
*'''Altitude''' 
*'''Ground speed''' 
*'''Course'''


These values are taken from standard CAN messages designed for GNSS/RTK data. Exact PGNs and signal layouts depend on whether external RTK/ECD/ISOBUS system is being used.
For proper functionality, the device requires ignition to be active. Source of ignition and voltage level can be selected from '''System''' tab.


==Configurator Setup== 
Ignition has to be active for at least 14 sec to start generating the DTC list. If ignition is turned off, the device will clean all DM1 and DM2 codes and functionality will not be working.
This section describes how to enable RTK as a location source and configure RS232 and CAN usage through the Configurator.


'''Enabling RTK as a location source'''
[[File:DTC_Ignition.png]]
[[File:Source Location from RTK.png|right]]
#Open the Configurator and connect to the FMC650 device.
#Navigate to the System tab. 
#Find the option “Source Location from RTK” in the '''System Settings''' section.
#Set this option to '''Enable'''.


When enabled, the device will use RTK data from RS232/CAN if available, with automatic fallback to internal GNSS.
After the device is connected to the Configurator, there will be '''DM1 / DM2''' tab made available. There is a configurable DM1 / DM2 Data source parameter. This parameter selects the CAN source based on which device will parse DM data from. Based on selected data source, device will also call a request for DTCs.


For advanced configuration (e.g. via commands):
'''Note:''' The functionality is completely separated from the FMS source.


Source Location from RTK <br>
[[File:DTC Data source selection.png]]
'''Parameter ID:''' 55000 <br>
'''Values:''' 
*'''0''' – Disabled (device uses only internal GNSS) 
*'''1''' – Enabled (device uses RTK sources if available)


Configuring RS232 for RTK Use 
*NONE – Device will not use any CAN as data source
If you plan to use an external RTK receiver via RS232: 
*CAN1 – Device will use CAN1 as data source
#Open the RS232/RS485 tab in the Configurator. 
*CAN2 – Device will use CAN2 as data source
#For COM1 or COM2 (or both), set the mode to RTK.
*BOTH – Device will use CAN1 and CAN2 as data source


Relevant parameter IDs: 
Bellow '''Data source''' parameters there is a list of configurable IOs
*'''COM1 mode''' – Parameter ID 151 
*'''COM2 mode''' – Parameter ID 173 
*'''RTK mode''' – Value 60 
If at least one COM port is configured to RTK mode and valid RTK data is received, the device will use RS232 as the main coordinate source. 


[[File:RS232 settings - RTK.png|right]]
[[File:DTC Configurable IOs.png]]


'''Using CAN as the RTK Source'''
„DTC DM1“ and “DTC DM2“ shows the last DTC that has been detected. „Active DM1 List“ and „Active DM2 List“ provides a list of all active DTCs for a given source.
CAN-based RTK is used in the following cases: 
*None of the RS232 COM ports are configured in RTK mode, or 
*RS232 RTK data is not valid or not present.
When those conditions are met and valid CAN RTK data is received: 
*The device uses CAN as the coordinate source.
*The device continuously monitors the time between RTK messages. 
*If CAN RTK messages are delayed by more than 2 seconds, the device automatically reverts to internal GNSS to avoid stale coordinates.
<br>
RTK data taken from CAN includes: 
*'''Latitude 
*'''Longitude 
*'''Altitude 
*'''Ground speed 
*'''Course 


Configuration of RTK over CAN (e.g. PGN, source address, bitrate) depends on your external CAN/ISOBUS/RTK infrastructure and should follow that system’sdocumentation.
Example of generating DM1 / DM2 list: To register DM1 code, it is required to send a command using (pgn 0xFEFA). Device will first check if such DTC code exist in the system (MCUID and CAN Source has to be unique for each DTC). Otherwise, DTC will be rejected.


'''ISOBUS Data Visibility''' 
[[File:DTC Configurator outputs.png]]
When used in ISOBUS or similar environments: 
[[File:ISOBUS - RTK.png]]
*RTK-related data from CAN is visible in the ISOBUS section of the Configurator. 


*This allows you to verify that RTK data is being received and interpreted correctly by the device. 
<span style="color:green;">9D000301:<span style="color:blue;">01:<span style="color:red;">01
*<span style="color:green;">9D000301</span> – DTC in hexadecimal format
*<span style="color:blue;">01</span> – MCU source that reported the DTC
*<span style="color:red;">01</span> – Device CAN source used (00 - CAN1, 01 - CAN2)


==Active Location Source Monitoring==
<span style="color:green;">9D000302:<span style="color:blue;">02:<span style="color:red;">01
To understand which source is currently being used for position data, you can check the '''Location Source''' parameter. 
*<span style="color:green;">9D000302</span> – DTC in hexadecimal format
*<span style="color:blue;">02</span> – MCU source that reported the DTC
*<span style="color:red;">01</span> – Device CAN source used (00 - CAN1, 01 - CAN2)


'''Location Source Values'''
Based on configured „Priority“, „Event Only“ and „Operand“ device will add this parameter to record.


In the Configurator: 
[[File:DTC Terminal logs.png]]
#Navigate to the '''I/O''' tab (or equivalent I/O monitoring view).
#Find the parameter '''Location Source'''.
[[File:Location source.png]]


Possible values:
To remove one of the DTC from DM1 list, DM2 code (pgn 0xFEFB) is required. Device will check if the sent DTC code exists in the system (MCUID and CAN Source has to be unique for each DTC). If sent DTC does not exist in the system, it will be rejected.


*'''0 – GNS'''
Based on previous example, sending DTC 9D000301 with MCUID 01 on CAN2, device remove this DTC from the system, as the result, this DTC is removed from „Active DM1 List“ and added to the „Active DM2 List“.
Location is taken from the internal GNSS receiver. This is the default when RTK is disabled or when no valid RTK data is available.


*'''1 – RS232'''
[[File:DTC Configurator outputs 2.png]]
Location is taken from the RTK receiver connected via RS232.


*'''2 – CAN'''
Log example:
Location is taken from RTK data arriving over CAN.


*'''3 – Err'''
[[File:DTC Terminal logs 2.png]]
Location is taken from the internal GNSS receiver, but this status indicates that RTK data from RS232 and/or CAN is invalid or unavailable. This helps distinguish normal GNSS use from “RTK expected but not available” situations.


This parameter is used for diagnostics and for confirming that your device is using the intended RTK source.
That DTCs will be added to record and would be accessible on server. Data on server need to be converted from HEX to ASCII.


==NMEA Fix Type Monitoring (RS232 RTK Only)==
[[File:DTC Outputs from server.png]]
When RTK coordinates are received via RS232, you can also monitor the NMEA Fix Type to understand the quality of the GNSS/RTK fix.


'''Configurator Steps'''
'''39443030303330323A30323A30313B''' -> (after conversion from hex to ANSCII) '''9D000302:02:01''';
#Open the Configurator. 
#Go to the I/O tab (or relevant section)
#Locate the parameter '''NMEA Fix Type'''.


[[File:NMEA Fix Type.png]]
'''39443030303330313A30313A30313B''' -> (after conversion from hex to ANSCII) '''9D000301:01:01''';


'''Note:''' This parameter is '''only available when coordinate data is received via RS232 RTK'''
==Functionality Block Diagram==
Graphic representation of '''DM1''' and '''DM2''' functionality:


'''NMEA Fix Type Values'''
[[File:DTC Functionality blok diagram.png]]


*'''NotValid''' - No valid GNSS fix is available.<br>


*'''GPS''' - Standard GPS fix using satellites only.<br>
==DM1 Lamp Status and Flash Signals==


*'''DGNSS''' - Differential GNSS fix (e.g. DGNSS, SBAS, etc.).<br>
The '''DM1 (Diagnostic Message 1)''' in the '''J1939''' protocol reports active '''Diagnostic Trouble Codes (DTCs)''' and controls vehicle warning indicators. It defines the behavior of the '''Malfunction Indicator Lamp (MIL)''' and other warning lamps, which can be off, on solid, or flashing, depending on the severity and priority of detected faults. Flashing typically signals a more urgent or severe condition, while a solid light indicates an active but less critical issue.


*'''NotApplicable''' - Fix quality is not applicable in the current context. <br>
The first byte represents the status of four indicator lamps:


*'''RTK_Fixed''' - RTK Fixed; high-precision RTK fix (including xFill if supported by the receiver).<br>
*'''PL (Protect Lamp)''' - DTC's indicate non-electronic subsystem issue.
*'''AWL(Amber Warning Light)''' - DTC's indicate a non-critical issue that does not warrant stopping the vehicle.


*'''RTK_Float''' - RTK Float; typically, a converging RTK solution or similar intermediate status.<br>
*'''RSL(Red Stop Lamp)''' - DTC's indicate a critical issue that warrants stopping the vehicle immediately.  


*'''INS_DR''' - INS Dead Reckoning; position estimated by inertial sensors and previous GNSS/RTK data.<br> 
*'''MIL(Malfunction Indicator Lamp)''' - At least one DTC indicates emissions related issue.


This information is beneficial for:
Each lamp is encoded using 2 bits, allowing four possible states: '''off, on, slow flash, and fast flash'''. This compact encoding means all lamp states are conveyed within a single byte, with each pair of bits mapped to a specific lamp in a fixed order. These lamp states directly inform the operator about the severity and urgency of active faults.
*Verifying that the external RTK receiver is working correctly.
*Assessing overall RTK performance and stability.
*Logging and diagnostics in advanced deployments.


==Parameter IDs and AVL IDs==
DM1 encodes warning lamp information in its first 2 bytes, combining both lamp status  and flash behavior. Each lamp is represented by two 2-bit fields—one in byte 1 (status) and one in byte 2 (flash).


Below is a list of AVL IDs and Configurator IDs assigned to a specific item.
To decode, split each byte into 2-bit segments and map each pair to its corresponding lamp. The final behavior is determined by combining status and flash (e.g., ON + fast flash = rapidly blinking warning).


<table class="nd-othertables_2" style="width:50%; border-collapse: collapse;">
==Global and Manufacturer SPN Codes==


<tr>
===Global-Level SPN codes===
<th style="width:8%; vertical-align: middle; text-align: left;">Name</th>
<th style="width:15%; vertical-align: middle; text-align: center;">Parameter ID</th>
<th style="width:5%; vertical-align: middle; text-align: center;">AVL ID</th>
</tr>


<tr>
Standard codes are defined by the SAE J1939 standards and are recognized across all compliant vehicles and equipment. The SPNs for these codes fall within the range of '''1 to 24,324''' representing widely used parameters such as engine speed, coolant temperature, or oil pressure. FMI values are standardized, describing specific failure patterns such as high voltage, circuit open, or out-of-range conditions.
<td style="vertical-align: middle; text-align: center;">RTK Longitude</td>
<td style="vertical-align: middle; text-align: center;">151790</td>
<td style="vertical-align: middle; text-align: center;">14145</td>
</tr>


<tr>
Because they are standardized, these codes are universally interpretable by any compliant diagnostic tool without requiring manufacturer-specific references.
<td style="vertical-align: middle; text-align: center;">RTK Latitude</td>
<td style="vertical-align: middle; text-align: center;">151800</td>
<td style="vertical-align: middle; text-align: center;">14146</td>
</tr>


<tr>
===Manufacturer-Level SPN codes===
<td style="vertical-align: middle; text-align: center;">RTK Altitude</td>
<td style="vertical-align: middle; text-align: center;">151810</td>
<td style="vertical-align: middle; text-align: center;">14147</td>
</tr>


<tr>
Manufacturer-level or proprietary codes are reserved for OEM-specific faults that are not defined in the J1939 standard. These allow manufacturers to monitor unique components, systems, or operational conditions that are specific to their equipment.
<td style="vertical-align: middle; text-align: center;">RTK Speed</td>
<td style="vertical-align: middle; text-align: center;">151820</td>
<td style="vertical-align: middle; text-align: center;">14148</td>
</tr>


<tr>
The SPNs for proprietary codes typically occupy the high end of the 19-bit field, ranging from '''516,096 to 524,287'''. FMI values may be standard or custom, but the meaning of the SPN is defined by the manufacturer. Accurate interpretation requires access to OEM documentation, as these codes are not universally defined or interpretable.
<td style="vertical-align: middle; text-align: center;">RTK Angle</td>
<td style="vertical-align: middle; text-align: center;">151830</td>
<td style="vertical-align: middle; text-align: center;">14149</td>
</tr>


<tr>
==DM1/DM2 Message Structure==
<td style="vertical-align: middle; text-align: center;">Source Location from RTK</td>
<td style="vertical-align: middle; text-align: center;">55000</td>
<td style="vertical-align: middle; text-align: center;">-</td>
</tr>


<tr>
Each DM1/DM2 message is transmitted using the J1939 transport protocol when needed (multi-packet if the data exceeds 8 bytes), but can also fit within a single CAN frame when only one DTC is present. The message begins with a lamp status byte, followed by zero or more DTC entries, each occupying exactly 4 bytes.
<td style="vertical-align: middle; text-align: center;">Source Location from RTK</td>
<td style="vertical-align: middle; text-align: center;">55000</td>
<td style="vertical-align: middle; text-align: center;">-</td>
</tr>


<tr>
<td style="vertical-align: middle; text-align: center;">Location Source</td>
<td style="vertical-align: middle; text-align: center;">53050</td>
<td style="vertical-align: middle; text-align: center;">10919</td>
</tr>


<tr>
 
<td style="vertical-align: middle; text-align: center;">NMEA Fix Type</td>
Following the lamp status byte, the message contains one or more Diagnostic Trouble Codes (DTCs). Each DTC is encoded in a 4-byte structure that combines several fields into a compact binary format. The first 19 bits represent the Suspect Parameter Number (SPN), which identifies the specific parameter or component that is faulty. This value is split across the first three bytes in a non-linear way, requiring bit-level extraction rather than simple byte parsing.
<td style="vertical-align: middle; text-align: center;">53060</td>
 
<td style="vertical-align: middle; text-align: center;">10920</td>
The next 5 bits define the Failure Mode Identifier (FMI), which describes how the failure manifests (for example, data out of range, voltage too high, or signal erratic). Together, the SPN and FMI uniquely describe the nature of the fault.
</tr>
 
After the FMI, a single bit is used for the SPN Conversion Method (CM). In modern systems, this bit is almost always set to 0, indicating the standard encoding method is used. A value of 1 indicates an alternative legacy encoding, which is rarely encountered but must still be handled correctly in robust implementations.
 
The final 7 bits of the 4-byte DTC structure represent the Occurrence Count (OC). This value indicates how many times the fault has been detected. It is typically capped at 127 and provides useful insight into whether a fault is intermittent or persistent.
 
When multiple DTCs are present, they are simply appended sequentially after the lamp status byte, each occupying 4 bytes. There is no explicit delimiter between DTCs; instead, the total message length determines how many are included. In multi-packet transmissions, this sequence continues seamlessly across transport protocol frames.
 
Practical Interpretation and DM1 vs DM2 Context
 
From an implementation perspective, decoding DM1 and DM2 messages requires careful bit extraction and reconstruction of the SPN, FMI, CM, and OC fields from each 4-byte DTC block. The lamp status byte must be interpreted separately before processing the DTC list.
 
The practical difference between DM1 and DM2 lies not in structure but in semantics. DM1 messages are typically broadcast periodically (for example, once per second) whenever active faults exist, making them essential for real-time monitoring and dashboards. In contrast, DM2 messages are only transmitted upon request and provide access to historical fault data that is no longer active but still stored in the ECU memory.
 
An important implementation detail is that DM1 messages may contain no DTCs, in which case only the lamp status byte is transmitted. This indicates that no active faults are present, and all lamps are typically off. However, the system must still correctly interpret this as a valid message rather than an error condition.
 
Another subtle but important aspect is that multiple ECUs on the same network can transmit their own DM1 messages independently. Each message is identified by its source address, meaning a complete diagnostic picture requires aggregating DM1 data across all nodes on the network.
 
In summary, the DM1/DM2 message structure is compact but highly information-dense. A single byte conveys overall system warning states, while each 4-byte DTC block encodes a complete fault description including what failed, how it failed, and how often it has occurred. Proper decoding requires precise bit-level handling, but once implemented, it provides a standardized and scalable way to monitor and diagnose vehicle systems across the entire J1939 network.

Latest revision as of 15:29, 26 March 2026

Introduction

With a professional device lineup, telltale information (dashboard indicators) from heavy-duty vehicles can be read remotely to identify a variety of issues. New feature of Diagnostic Trouble Code (DTC) reading will help to narrow down the specific faults happening in vehicles.

With {{{model}}} you can read 2 types of DTC messages based on J1939 protocol:

  • DM1 – Communicates currently present faults
  • DM2 – Reports stored faults

{{{model}}} is able to read DM codes and pass them to the server in IO element. When active DM1 or DM2 messages appear on CAN line it is broadcasted very often – {{{model}}} device saves the codes into the internal memory and does not flood the server with irrelevant information – only new DTC codes are sent to the server.

Functionality Description

This functionality is available from Firmware version 03.01.02.rev.06 or higher.

For proper functionality, the device requires ignition to be active. Source of ignition and voltage level can be selected from System tab.

Ignition has to be active for at least 14 sec to start generating the DTC list. If ignition is turned off, the device will clean all DM1 and DM2 codes and functionality will not be working.

After the device is connected to the Configurator, there will be DM1 / DM2 tab made available. There is a configurable DM1 / DM2 Data source parameter. This parameter selects the CAN source based on which device will parse DM data from. Based on selected data source, device will also call a request for DTCs.

Note: The functionality is completely separated from the FMS source.

  • NONE – Device will not use any CAN as data source
  • CAN1 – Device will use CAN1 as data source
  • CAN2 – Device will use CAN2 as data source
  • BOTH – Device will use CAN1 and CAN2 as data source

Bellow Data source parameters there is a list of configurable IOs

„DTC DM1“ and “DTC DM2“ shows the last DTC that has been detected. „Active DM1 List“ and „Active DM2 List“ provides a list of all active DTCs for a given source.

Example of generating DM1 / DM2 list: To register DM1 code, it is required to send a command using (pgn 0xFEFA). Device will first check if such DTC code exist in the system (MCUID and CAN Source has to be unique for each DTC). Otherwise, DTC will be rejected.

9D000301:01:01

  • 9D000301 – DTC in hexadecimal format
  • 01 – MCU source that reported the DTC
  • 01 – Device CAN source used (00 - CAN1, 01 - CAN2)

9D000302:02:01

  • 9D000302 – DTC in hexadecimal format
  • 02 – MCU source that reported the DTC
  • 01 – Device CAN source used (00 - CAN1, 01 - CAN2)

Based on configured „Priority“, „Event Only“ and „Operand“ device will add this parameter to record.

To remove one of the DTC from DM1 list, DM2 code (pgn 0xFEFB) is required. Device will check if the sent DTC code exists in the system (MCUID and CAN Source has to be unique for each DTC). If sent DTC does not exist in the system, it will be rejected.

Based on previous example, sending DTC 9D000301 with MCUID 01 on CAN2, device remove this DTC from the system, as the result, this DTC is removed from „Active DM1 List“ and added to the „Active DM2 List“.

Log example:

That DTCs will be added to record and would be accessible on server. Data on server need to be converted from HEX to ASCII.

39443030303330323A30323A30313B -> (after conversion from hex to ANSCII) 9D000302:02:01;

39443030303330313A30313A30313B -> (after conversion from hex to ANSCII) 9D000301:01:01;

Functionality Block Diagram

Graphic representation of DM1 and DM2 functionality:


DM1 Lamp Status and Flash Signals

The DM1 (Diagnostic Message 1) in the J1939 protocol reports active Diagnostic Trouble Codes (DTCs) and controls vehicle warning indicators. It defines the behavior of the Malfunction Indicator Lamp (MIL) and other warning lamps, which can be off, on solid, or flashing, depending on the severity and priority of detected faults. Flashing typically signals a more urgent or severe condition, while a solid light indicates an active but less critical issue.

The first byte represents the status of four indicator lamps:

  • PL (Protect Lamp) - DTC's indicate non-electronic subsystem issue.
  • AWL(Amber Warning Light) - DTC's indicate a non-critical issue that does not warrant stopping the vehicle.
  • RSL(Red Stop Lamp) - DTC's indicate a critical issue that warrants stopping the vehicle immediately.
  • MIL(Malfunction Indicator Lamp) - At least one DTC indicates emissions related issue.

Each lamp is encoded using 2 bits, allowing four possible states: off, on, slow flash, and fast flash. This compact encoding means all lamp states are conveyed within a single byte, with each pair of bits mapped to a specific lamp in a fixed order. These lamp states directly inform the operator about the severity and urgency of active faults.

DM1 encodes warning lamp information in its first 2 bytes, combining both lamp status and flash behavior. Each lamp is represented by two 2-bit fields—one in byte 1 (status) and one in byte 2 (flash).

To decode, split each byte into 2-bit segments and map each pair to its corresponding lamp. The final behavior is determined by combining status and flash (e.g., ON + fast flash = rapidly blinking warning).

Global and Manufacturer SPN Codes

Global-Level SPN codes

Standard codes are defined by the SAE J1939 standards and are recognized across all compliant vehicles and equipment. The SPNs for these codes fall within the range of 1 to 24,324 representing widely used parameters such as engine speed, coolant temperature, or oil pressure. FMI values are standardized, describing specific failure patterns such as high voltage, circuit open, or out-of-range conditions.

Because they are standardized, these codes are universally interpretable by any compliant diagnostic tool without requiring manufacturer-specific references.

Manufacturer-Level SPN codes

Manufacturer-level or proprietary codes are reserved for OEM-specific faults that are not defined in the J1939 standard. These allow manufacturers to monitor unique components, systems, or operational conditions that are specific to their equipment.

The SPNs for proprietary codes typically occupy the high end of the 19-bit field, ranging from 516,096 to 524,287. FMI values may be standard or custom, but the meaning of the SPN is defined by the manufacturer. Accurate interpretation requires access to OEM documentation, as these codes are not universally defined or interpretable.

DM1/DM2 Message Structure

Each DM1/DM2 message is transmitted using the J1939 transport protocol when needed (multi-packet if the data exceeds 8 bytes), but can also fit within a single CAN frame when only one DTC is present. The message begins with a lamp status byte, followed by zero or more DTC entries, each occupying exactly 4 bytes.


Following the lamp status byte, the message contains one or more Diagnostic Trouble Codes (DTCs). Each DTC is encoded in a 4-byte structure that combines several fields into a compact binary format. The first 19 bits represent the Suspect Parameter Number (SPN), which identifies the specific parameter or component that is faulty. This value is split across the first three bytes in a non-linear way, requiring bit-level extraction rather than simple byte parsing.

The next 5 bits define the Failure Mode Identifier (FMI), which describes how the failure manifests (for example, data out of range, voltage too high, or signal erratic). Together, the SPN and FMI uniquely describe the nature of the fault.

After the FMI, a single bit is used for the SPN Conversion Method (CM). In modern systems, this bit is almost always set to 0, indicating the standard encoding method is used. A value of 1 indicates an alternative legacy encoding, which is rarely encountered but must still be handled correctly in robust implementations.

The final 7 bits of the 4-byte DTC structure represent the Occurrence Count (OC). This value indicates how many times the fault has been detected. It is typically capped at 127 and provides useful insight into whether a fault is intermittent or persistent.

When multiple DTCs are present, they are simply appended sequentially after the lamp status byte, each occupying 4 bytes. There is no explicit delimiter between DTCs; instead, the total message length determines how many are included. In multi-packet transmissions, this sequence continues seamlessly across transport protocol frames.

Practical Interpretation and DM1 vs DM2 Context

From an implementation perspective, decoding DM1 and DM2 messages requires careful bit extraction and reconstruction of the SPN, FMI, CM, and OC fields from each 4-byte DTC block. The lamp status byte must be interpreted separately before processing the DTC list.

The practical difference between DM1 and DM2 lies not in structure but in semantics. DM1 messages are typically broadcast periodically (for example, once per second) whenever active faults exist, making them essential for real-time monitoring and dashboards. In contrast, DM2 messages are only transmitted upon request and provide access to historical fault data that is no longer active but still stored in the ECU memory.

An important implementation detail is that DM1 messages may contain no DTCs, in which case only the lamp status byte is transmitted. This indicates that no active faults are present, and all lamps are typically off. However, the system must still correctly interpret this as a valid message rather than an error condition.

Another subtle but important aspect is that multiple ECUs on the same network can transmit their own DM1 messages independently. Each message is identified by its source address, meaning a complete diagnostic picture requires aggregating DM1 data across all nodes on the network.

In summary, the DM1/DM2 message structure is compact but highly information-dense. A single byte conveys overall system warning states, while each 4-byte DTC block encodes a complete fault description including what failed, how it failed, and how often it has occurred. Proper decoding requires precise bit-level handling, but once implemented, it provides a standardized and scalable way to monitor and diagnose vehicle systems across the entire J1939 network.