J1939 Diagnostic Message Parsing¶
This section covers how the PDC parses J1939 Diagnostic Messages (DM1, DM2, DM53) and custom error protocols.
The <DM1_DM2Message> element in <BinaryStreamDefinition> selects the parsing behaviour via the conversionMode attribute.
The Diagnostic Messages (DM) will be transmitted in CAN messages. The Proemion system interprets these CAN messages in the PDC.
To interpret the correct arrangement in the SPN, choose the SPN Conversion Method according to your engine or ECU datasheet.
Support of DM1 and DM2 for DTCs¶
DataPlatform DM1 and DM2 behaviour
DM1 messages contain a list of DTCs currently active on the machine. DTCs present in the message that are not already known as active are stored as newly active DTCs in the DataPlatform. Already known active DTCs are ignored. DTCs currently active in the DataPlatform but absent from a newly received DM1 message are deactivated. An empty DM1 message closes all active DTCs.
DM2 messages contain previously active DTCs. On the DataPlatform these messages are used for closing potentially active DTCs. If a currently active DTC is present in the DM2 message, it is deactivated. Currently, there is no other function for DM2 messages.
The following example shows how messages for DM1_DM2 will be implemented in the PDC.
The channel number defined in the <BinaryStreamDefinition> is used as the designator for the matching <DM1_DM2Message> or <CanMessage> received at the DataPlatform.
The channel number must match the receiving CAN message.
It is recommended to define CAN message parsing for each channel separately instead of using a combination of channel-agnostic and channel-specific <BinaryStreamDefinition> elements.
If there is no matching <DM1_DM2Message> or <CanMessage> for a message on a configured channel, the message will not be parsed.
PDC configuration
<!-- ParsingDefinition -->
<ParsingDefinition>
<BinaryStreamDefinition src="CAN" channel="1">
<CanMessage canId="0x101" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC"> [18 lines]
<CanMessage canId="0x102" canIdLength="11" mask="0x7FF" protocolStyle="GENERIC">
...
</CanMessage>
<DM1_DM2Message conversionMode="2" sourceAddress="0x83" readLampStatus="false"/>
<DM1_DM2Message conversionMode="1"/>
</BinaryStreamDefinition>
</ParsingDefinition>
| Element/Attribute | Description |
|---|---|
<DM1_DM2Message> |
DM1: Active Diagnostic Trouble Codes. DM2: Previously Active Diagnostic Trouble Codes. |
conversionMode |
Specifies the SPN conversion method. Valid values: 1, 2, 3 (standard J1939, used when the CM-Bit is set, see Standard Conversion Modes), 100 (DTC as UINT32), 101 (custom error protocol). |
sourceAddress |
Optional. If set, the conversion mode is used only for this address. If not set, all addresses use the same conversion mode. |
readLampStatus |
If set to false, the lamp status value is not read from the J1939 DM1/2 messages. If no lamp status is available in the database, the lamp status will not be displayed in the DataPortal views and widgets. |
Support of DM53 Messages for DTCs¶
The Diagnostic Message DM53 is used for Active Service Only DTCs (DM53). It is a subset of DM1_DM2Message and shows actual DTCs, not only the available diagnostic messages.
PDC configuration
<ParsingDefinition>
<BinaryStreamDefinition src="CAN">
<DM53Message conversionMode="1" sourceAddress="0x34"/>
</BinaryStreamDefinition>
</ParsingDefinition>
| Element/Attribute | Description |
|---|---|
<DM53Message> |
Active Service Only DTCs. Unlike <DM1_DM2Message>, it has no readLampStatus attribute. |
conversionMode |
Specifies the SPN conversion method. Valid values: 1, 2, 3 (standard J1939, used when the CM-Bit is set, see Standard Conversion Modes), 100 (DTC as UINT32). The custom error protocol mode 101 is not supported for DM53. |
sourceAddress |
Optional. If set, the conversion mode is used only for this address. If not set, all addresses use the same conversion mode. |
Standard Conversion Modes (1–4)¶
Standard conversion modes define how the SPN field is interpreted within a J1939 DM1/DM2 message. Choose the mode according to the engine or ECU datasheet.
The four standard conversion methods are illustrated in the figures below.




If the CM-Bit (Conversion Method) is set to 1 in the CAN message, indicate the relevant conversion method (Version 1 to 3) as the value of conversionMode, for example conversionMode="2".
If the CM-Bit is set to 0, Version 4 is set by default and the PDC setting is ignored.
Conversion modes 3 and 4 are identical: the CAN messages are interpreted in the same manner. The difference is that mode 4 is used automatically while mode 3 can be set manually. Using mode 3 instead of mode 4 produces no error when checking the PDC.
Proprietary Conversion Modes¶
Proemion defines two conversion modes outside the J1939 standard for machines that transmit diagnostic data in a non-standard format.
Mode 100: DTC as UINT32¶
In conversion mode 100, every 4-byte DM1 DTC block is interpreted as a UINT32 number and set as the SPN ID. FMI defaults to 0. If FMI must be derived from a lookup file, contact Support.
Mode 101: Custom Error Protocol¶
Conversion mode 101 is a proprietary extension for machines that transmit errors in a custom CAN format that cannot be mapped to standard J1939 DM1, for example when the priority field exceeds the 5-bit FMI limit of the J1939 standard.
The controller application sends a snapshot of all currently active errors as a sequence of 6-byte entries under the J1939 DM1 PGN (0xFECA).
Each entry maps to J1939 fields as follows:
| Field | Maps to | Data type | Size | Byte order |
|---|---|---|---|---|
LOCATION |
Source address | UINT16 | 2 bytes | LSB first (byte 0) |
Type |
SPN ID | UINT16 | 2 bytes | LSB first (byte 0) |
PRIORITY |
FMI ID | UINT16 | 2 bytes | LSB first (byte 0) |
The payload structure for multiple active errors:
| ERROR 1 | ERROR 2 | ... | ERROR n |
| LOCATION | Type | PRIORITY | LOCATION | Type | PRIORITY | ... | LOCATION | Type | PRIORITY |
| 2 bytes | 2 bytes| 2 bytes | 2 bytes | 2 bytes| 2 bytes | ... | 2 bytes | 2 bytes| 2 bytes |
All values are unsigned integers. Empty bytes are not padded with 0xFF.
Up to 256 errors can be transmitted per message.
All errors share the same J1939 source address. Lamp status is not transmitted.
When no errors are active, the controller sends a single entry with all fields set to 0, following the J1939 DM1 convention for signalling an empty error list.
Warning
A resolved subset of errors cannot be identified from the CAN message alone. The no-error entry (LOCATION = 0, Type = 0, PRIORITY = 0) only appears after all active errors have been resolved.
PDC configuration
<ParsingDefinition>
<BinaryStreamDefinition src="CAN">
<DM1_DM2Message conversionMode="101" sourceAddress="0x80" readLampStatus="false"/>
</BinaryStreamDefinition>
</ParsingDefinition>
The LOCATION, Type, and PRIORITY fields map to J1939 source address, SPN, and FMI respectively. Default J1939 labels can be overridden using <SourceLabelOverrides>, <SpnLabelOverrides>, and <FmiLabelOverrides>. See J1939 Label Overrides below.
J1939 Label Overrides¶
To display J1939 error codes (source address, SPN, and FMI) as text in the DataPortal, add the following lines to the PDC immediately before the <Unit> tag.
<J1939>
<xi:include href="https://xml.proemion.com/ProemionDataConfiguration/J1939_202503_SpnLabels.xml"/>
</J1939>
It is possible to override the default J1939 texts for source address, SPN, and FMI with custom labels. Add the following lines to your PDC.
The content of the value attribute can be defined freely.
J1939 label override XML example (click to view)
<!-- J1939 -->
<J1939>
<xi:include href="https://xml.proemion.com/ProemionDataConfiguration/J1939_202503_SpnLabels.xml"/>
<SpnLabelOverrides>
<Spn id="6">
<message>
<Label lang="fr" value="My new SPN 6"/>
</message>
</Spn>
<Spn id="7" forSourceAddress="7">
<message>
<Label lang="fr" value="My new SPN 7"/>
</message>
</Spn>
</SpnLabelOverrides>
<FmiLabelOverrides>
<Fmi code="13" forSourceAddress="12">
<message>
<Label lang="en" value="My new FMI 13"/>
</message>
</Fmi>
<Fmi code="14">
<message>
<Label lang="en" value="My new FMI 14"/>
</message>
</Fmi>
</FmiLabelOverrides>
<SourceLabelOverrides>
<Source address="1">
<message>
<Label lang="de" value="My new Source 1"/>
</message>
</Source>
<Source address="2">
<message>
<Label lang="de" value="My new Source 2"/>
</message>
</Source>
</SourceLabelOverrides>
</J1939>
| Element/Attribute | Description |
|---|---|
<SpnLabelOverrides> |
Overrides the standard label for a Suspect Parameter Number (SPN). |
Spn |
Defines that a SPN label should be changed. |
id |
Defines which SPN should be relabelled. |
lang |
Language code for the label. Depending on the DataPortal language settings the equivalent value is displayed. |
value |
Replacement label for the specified language. |
forSourceAddress |
Optional. Restricts the override to a specific source address. |
<FmiLabelOverrides> |
Overrides the standard label for a Failure Mode Identifier (FMI). |
Fmi |
Defines that an FMI label should be changed. |
code |
Defines which FMI code should be relabelled. |
<SourceLabelOverrides> |
Overrides the standard label for a source address (typically an ECU). |
address |
Defines the source address to be relabelled. |