0% found this document useful (0 votes)
98 views68 pages

TechnicalReference J1939Dcm

TechnicalReference_J1939Dcm

Uploaded by

ashish.santani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views68 pages

TechnicalReference J1939Dcm

TechnicalReference_J1939Dcm

Uploaded by

ashish.santani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

MICROSAR Classic J1939 Diagnostic

Communication Manager
Technical Reference

Version 17.0.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Document Information
History

Author Date Version Remarks


visdth 2013-02-20 1.0.0 Initial document version
visdth 2014-04-14 2.0.0 > J1939Dcm_InitMemory added
> StartofReception according to AR4.1.2
visdth 2014-08-21 2.1.0 > BETA status removed
> Multiple Nodes Limitations added
visdth 2015-05-27 3.0.0 > Version update for major component release
visaey 2016-03-01 4.0.0 > Updated the API J1939Dcm_RequestIndication
> Added diagnostic messages 27, 53, 54, and 55
> Indicating the use of new DEM interface API
Dem_J1939DcmReadDiagnosticReadiness1
visaey 2016-04-27 4.1.0 > Added post-build selectable
> Added post-build loadable
> Added post-build loadable selectable
> Added post-build deletable
visaey 2016-06-16 4.2.0 > Added ISOBUS feature
visaey 2017-09-18 7.0.0 > Upgrade interface with Dem according to AR4.3.0
visaey 2017-11-10 7.0.1 > Downgrade interface with PduR according to
AR4.2.2
visaey 2019-07-16 11.2.0 > Change module interface schematic diagram
viswse 2019-10-29 12.2.0 > Updated the API J1939Dcm_CopyRxData
visuvo 2020-06-05 13.1.0 > Added chapter 3.6 Deviations
> Added section 6.3 Configurable Attributes
> Added chapter 7 Using the J1939Dcm
visuvo 2021-02-15 13.4.0 > Updated History
> Deleted Component History
visuvo 2021-05-27 14.0.0 > No relevant changes
alefarth, 2022-04-21 15.0.0 > Product name updated to MICROSAR Classic
visepp
> Added Memory Mapping
visuvo, 2022-06-08 15.2.0 > Added diagnostic message 6, 12, 23 and 28
visepp
> Removed restrictions for diagnostic message 5
visuvo 2022-07-01 15.3.0 > Added diagnostic message 20, 21 and 29
visuvo 2022-08-04 15.4.0 > Added Caution Box in chapter 5.1 Configuration
Variants

© 2024 Vector Informatik GmbH Version 17.0.1 2


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

visuvo 2022-08-16 16.0.0 > Added diagnostic messages 7, 8, 19, 26, 33 and 58
> Adapt diagnostic message 24 for Autosar
compliance (use of Dem API call instead of
preconfigured ROM table for SPNs supported in
Expanded Freeze Frame)
> Added chapter 2.4.3.1 DM13 and Broadcast-
Command prioritization
visuvo 2022-10-24 16.1.0 > Added diagnostic messages 30 and 34
visuvo 2022-11-23 16.2.0 > Added diagnostic messages 10, 56 and 57
visuvo 2023-02-15 16.2.1 > Adaption of Caution Box in chapter 5.1 Configuration
Variants
visepp 2023-04-21 16.3.0 > Added chapter 6.2 How to handle Meta Data for
reception of Diagnostic Messages
visuvo 2024-03-22 17.0.0 > Added diagnostic message 22
> Adaption of functional deviation for DM01 in table
Table 2-7 Supported features with deviations
visuvo 2024-06-06 17.0.1 > Added chapter 6.4 How to mark a Node as OBD
specific Node

Reference Documents

No. Source Title Version


[1] AUTOSAR Specification of a Diagnostic Communication Manager for SAE R19-11
J1939
[2] AUTOSAR Specification of Default Error Tracer R3.4.0
[3] AUTOSAR Specification of Diagnostic Event Manager R4.3.0
[4] AUTOSAR Specification of a Request Manager for SAE J1939 R1.1.0
[5] AUTOSAR Specification of PDU Router R4.1.0
[6] SAE J1939-73: Application Layer – Diagnostics JUL2013
[7] SAE J1939-21: Data Link Layer JAN2015
[8] Vector User Manual Post-Build Loadable -
[9] Vector User Manual Identity Manager -

Caution
We have configured the programs in accordance with your specifications in the
questionnaire. Whereas the programs do support other configurations than the one
specified in your questionnaire, Vector´s release of the programs delivered to your
company is expressly restricted to the configuration you have specified in the
questionnaire.

© 2024 Vector Informatik GmbH Version 17.0.1 3


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Contents

1 Introduction................................................................................................................. 10
1.1 Architecture Overview ...................................................................................... 10

2 Functional Description ............................................................................................... 12


2.1 Features .......................................................................................................... 12
2.1.1 Limitations........................................................................................ 13
2.1.1.1 DM1 Transmission on DTC status change ..................... 13
2.1.1.2 OBD Support ................................................................. 13
2.1.1.3 Parallel Message Processing and Multiple Nodes .......... 13
2.1.1.4 DM13 and Multiple Nodes .............................................. 14
2.2 Initialization ...................................................................................................... 14
2.3 States .............................................................................................................. 14
2.4 Main Functionality ............................................................................................ 14
2.4.1 Transmission of requested Diagnostic Messages............................. 14
2.4.2 Transmission of periodic messages ................................................. 15
2.4.2.1 ISOBUS channel............................................................ 15
2.4.3 Communication State Handling ........................................................ 15
2.4.3.1 DM13 and Broadcast-Command prioritization ................ 15
2.4.4 Memory Access................................................................................ 15
2.5 Error Handling .................................................................................................. 16
2.5.1 Development Error Reporting........................................................... 16
2.6 Deviations ........................................................................................................ 17
2.6.1 Interaction with MICROSAR Classic DEM when OBDII is licensed .. 19

3 Integration ................................................................................................................... 20
3.1 Scope of Delivery ............................................................................................. 20
3.1.1 Static Files ....................................................................................... 20
3.1.2 Dynamic Files .................................................................................. 20
3.1.3 Include Structure .............................................................................. 21
3.2 Critical Sections ............................................................................................... 21
3.3 Memory Access ............................................................................................... 22
3.3.1 Memory Access Request (DM14) ..................................................... 23
3.3.2 Memory Access Response (DM15) .................................................. 23
3.3.3 Binary Data Transfer (DM16) ........................................................... 23
3.3.4 Boot Load Data (DM17) ................................................................... 25
3.3.5 Data Security (DM18)....................................................................... 25
3.4 Access to Application ....................................................................................... 25
3.4.1 Command Non-Continuously Monitored Test (DM7) ........................ 26

© 2024 Vector Informatik GmbH Version 17.0.1 4


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

3.4.2 Provide test result for Non-Continuously Monitored Systems (DM8) 27


3.4.3 Supported Non-Continuously Monitored Systems Test Identifiers
(DM10) ............................................................................................. 28
3.4.4 Read out of Calibration Information (DM19) ..................................... 28
3.4.5 Provide Scaled Test Results (DM30) ................................................ 28
3.4.6 Read out EI-AECD Activation Time (DM33) ..................................... 29
3.4.7 NTE Status (DM34) .......................................................................... 29
3.4.8 Model Year and Certification Engine Family (DM56) ........................ 30
3.4.9 OBD Information (DM57) ................................................................. 30
3.4.10 Provide test result for Rationality Fault SPN Data (DM58) ............... 31
3.5 Post-build Modes ............................................................................................. 31
3.5.1 Post-build Selectable ....................................................................... 31
3.5.2 Post-build Loadable ......................................................................... 32
3.5.3 Post-build Loadable Selectable ........................................................ 32
3.5.4 Post-build Deletable ......................................................................... 32
3.5.5 Configuration.................................................................................... 32
3.5.6 Post-build Capable Containers ......................................................... 33
3.5.6.1 Diagnostic Messages ..................................................... 33
3.5.6.2 Channels ....................................................................... 33
3.5.6.3 Nodes ............................................................................ 33

4 API Description ........................................................................................................... 34


4.1 Type Definitions ............................................................................................... 34
4.1.1 J1939Dcm_CalibrationIDArrayType ................................................. 35
4.1.2 J1939Dcm_CertificationEngineFamilyNameType ............................. 35
4.1.3 J1939Dcm_ModelYearType ............................................................. 35
4.1.4 J1939Dcm_SupportedTestIdentifiersType ........................................ 36
4.2 Services provided by J1939DCM ..................................................................... 36
4.2.1 J1939Dcm_RequestIndication() ....................................................... 36
4.2.2 J1939Dcm_DeInit() .......................................................................... 36
4.2.3 J1939Dcm_GetVersionInfo() ............................................................ 37
4.2.4 J1939Dcm_Init()............................................................................... 37
4.2.5 J1939Dcm_InitMemory() .................................................................. 38
4.2.6 J1939Dcm_MainFunction() .............................................................. 38
4.2.7 J1939Dcm_SetState() ...................................................................... 39
4.2.8 J1939Dcm_MemResponseTransmit() .............................................. 39
4.2.9 J1939Dcm_MemDataTransmit() ...................................................... 40
4.2.10 J1939Dcm_ProvideTestResultOfDm8() ............................................ 41
4.2.11 J1939Dcm_ProvideTestResultOfDm30() .......................................... 41
4.2.12 J1939Dcm_ProvideTestResultOfDm58() .......................................... 42
4.3 Services used by J1939DCM ........................................................................... 44

© 2024 Vector Informatik GmbH Version 17.0.1 5


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4.4 Callback Functions........................................................................................... 45


4.4.1 J1939Dcm_CopyRxData() ............................................................... 45
4.4.2 J1939Dcm_CopyTxData() ................................................................ 45
4.4.3 J1939Dcm_StartOfReception() ........................................................ 46
4.4.4 J1939Dcm_RxIndication() ................................................................ 47
4.4.5 J1939Dcm_TpRxIndication() ............................................................ 48
4.4.6 J1939Dcm_TpTxConfirmation() ....................................................... 48
4.4.7 J1939Dcm_TxConfirmation() ........................................................... 49
4.4.8 J1939Dcm_DemTriggerOnDTCStatus () .......................................... 49
4.5 Configurable Interfaces .................................................................................... 50
4.5.1 Memory Access Callout Functions ................................................... 50
4.5.1.1 J1939DcmMemRequestIndicationFunc.......................... 50
4.5.1.2 J1939DcmMemResponseTxConfFunc........................... 51
4.5.1.3 J1939DcmMemDataStartOfReceptionFunc ................... 51
4.5.1.4 J1939DcmMemDataCopyRxFunc .................................. 52
4.5.1.5 J1939DcmMemDataRxIndicationFunc ........................... 52
4.5.1.6 J1939DcmMemDataTxConfFunc ................................... 53
4.5.2 Application Callout Functions ........................................................... 54
4.5.2.1 J1939Dcm_ExecuteTest() .............................................. 54
4.5.2.2 J1939Dcm_GetCalibrationVerificationNumber() ............. 55
4.5.2.3 J1939Dcm_GetDeviceActiveTime() ............................... 56
4.5.2.4 J1939Dcm_GetModelYear() ........................................... 57
4.5.2.5 J1939Dcm_GetNteStatus() ............................................ 57
4.5.2.6 J1939Dcm_GetObdInformation() ................................... 58
4.5.2.7 J1939Dcm_GetSupportedTestIdentifiers() ..................... 59
4.5.2.8 J1939Dcm_TestResultTxConfirmation() ......................... 59

5 Configuration .............................................................................................................. 61
5.1 Configuration Variants ...................................................................................... 61
5.2 Configuration in Data Base .............................................................................. 61
5.3 Configurable Attributes ..................................................................................... 62

6 Using the J1939Dcm................................................................................................... 63


6.1 How to handle DM13 Hold Signal 0001b .......................................................... 63
6.2 How to handle Meta Data for reception of Diagnostic Messages...................... 63
6.3 How to handle global DM22 requests............................................................... 64
6.4 How to mark a Node as OBD specific Node ..................................................... 65

7 Glossary and Abbreviations ...................................................................................... 66


7.1 Glossary .......................................................................................................... 66
7.2 Abbreviations ................................................................................................... 66

© 2024 Vector Informatik GmbH Version 17.0.1 6


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

8 Contact ........................................................................................................................ 68

© 2024 Vector Informatik GmbH Version 17.0.1 7


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Illustrations
Figure 1-1 AUTOSAR 4.1 Architecture Overview ....................................................... 10
Figure 1-2 Interfaces to adjacent modules of the J1939DCM ..................................... 11
Figure 2-1 J1939DCM Module States ........................................................................ 14
Figure 3-1 J1939DCM Include Structure .................................................................... 21
Figure 3-2 Memory Access: DM14 Reception Sequence ........................................... 23
Figure 3-3 Memory Access: DM15 Transmission Sequence ...................................... 23
Figure 3-4 Memory Access: DM16 Reception Sequence ........................................... 24
Figure 3-5 Memory Access: DM16 Transmission Sequence ...................................... 24
Figure 3-6 Memory Access: DM17 Reception Sequence ........................................... 25
Figure 3-7 Command Non-Continuously Monitored Test: DM7 Sequence.................. 27
Figure 3-8 Provide test result for Non-Continuously Monitored Systems: DM8
Sequence ................................................................................................. 27
Figure 3-9 Supported Non-Continuously Monitored Systems Test Identifiers: DM10
Sequence ................................................................................................. 28
Figure 3-10 Calibration Information: DM19 Sequence ................................................. 28
Figure 3-11 Provide Scaled Test Results: DM30 Sequence ......................................... 29
Figure 3-12 EI-AECD Activation Time: DM33 Sequence .............................................. 29
Figure 3-13 NTE Status: DM34 Sequence ................................................................... 30
Figure 3-14 Model Year and Certification Engine Family: DM56 Sequence ................. 30
Figure 3-15 OBD Information: DM57 Sequence........................................................... 31
Figure 3-16 Provide test result for Rationality Fault SPN Data: DM58 Sequence ......... 31
Figure 3-17 Configuration of J1939DcmMemAccessFunctions for post-build loadable 32
Figure 3-18 Configuration of DemGeneralJ1939 for post-build loadable ...................... 33
Figure 5-1 Definition of J1939 CAN identifiers in the DBC editor................................ 62

Tables
Table 2-1 Implemented Diagnostic Messages .......................................................... 13
Table 2-2 Additional Features ................................................................................... 13
Table 2-3 Broadcast-Command prioritization ............................................................ 15
Table 2-4 Service IDs ............................................................................................... 16
Table 2-5 Errors reported to DET ............................................................................. 17
Table 2-6 Not supported features ............................................................................. 18
Table 2-7 Supported features with deviations ........................................................... 19
Table 3-1 Static files ................................................................................................. 20
Table 3-2 Generated files ......................................................................................... 20
Table 3-3 Memory Access Interfaces provided by J1939DCM .................................. 22
Table 3-4 Application Interface provided by J1939DCM ........................................... 26
Table 4-1 Enumeration type definitions..................................................................... 34
Table 4-2 Structure type definitions .......................................................................... 35
Table 4-3 J1939Dcm_CalibrationIDArrayType .......................................................... 35
Table 4-4 J1939Dcm_CertificationEngineFamilyNameType ..................................... 35
Table 4-5 J1939Dcm_ModelYearType ...................................................................... 35
Table 4-6 J1939Dcm_SupportedTestIdentifiersType................................................. 36
Table 4-7 J1939Dcm_RequestIndication() ................................................................ 36
Table 4-8 J1939Dcm_DeInit() ................................................................................... 37
Table 4-9 J1939Dcm_GetVersionInfo()..................................................................... 37
Table 4-10 J1939Dcm_Init() ....................................................................................... 38
Table 4-11 J1939Dcm_InitMemory() .......................................................................... 38
Table 4-12 J1939Dcm_MainFunction() ....................................................................... 39
Table 4-13 J1939Dcm_SetState() .............................................................................. 39

© 2024 Vector Informatik GmbH Version 17.0.1 8


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Table 4-14 J1939Dcm_MemResponseTransmit() ....................................................... 40


Table 4-15 J1939Dcm_MemDataTransmit() ............................................................... 41
Table 4-16 J1939Dcm_ProvideTestResultOfDm8() .................................................... 41
Table 4-17 J1939Dcm_ProvideTestResultOfDm30() .................................................. 42
Table 4-18 J1939Dcm_ProvideTestResultOfDm58() .................................................. 43
Table 4-19 Services used by the J1939DCM .............................................................. 44
Table 4-20 J1939Dcm_CopyRxData() ........................................................................ 45
Table 4-21 J1939Dcm_CopyTxData() ........................................................................ 46
Table 4-22 J1939Dcm_StartOfReception() ................................................................. 47
Table 4-23 J1939Dcm_RxIndication()......................................................................... 48
Table 4-24 J1939Dcm_TpRxIndication() .................................................................... 48
Table 4-25 J1939Dcm_TpTxConfirmation() ................................................................ 49
Table 4-26 J1939Dcm_TxConfirmation() .................................................................... 49
Table 4-27 J1939Dcm_DemTriggerOnDTCStatus ()................................................... 50
Table 4-28 J1939DcmMemRequestIndicationFunc .................................................... 50
Table 4-29 J1939DcmMemResponseTxConfFunc ..................................................... 51
Table 4-30 J1939DcmMemDataStartOfReceptionFunc .............................................. 52
Table 4-31 J1939DcmMemDataCopyRxFunc............................................................. 52
Table 4-32 J1939DcmMemDataRxIndicationFunc ...................................................... 53
Table 4-33 J1939DcmMemDataTxConfFunc .............................................................. 54
Table 4-34 J1939Dcm_ExecuteTest() ......................................................................... 54
Table 4-35 J1939Dcm_GetCalibrationVerificationNumber()........................................ 56
Table 4-36 J1939Dcm_GetDeviceActiveTime() .......................................................... 57
Table 4-37 J1939Dcm_GetModelYear()...................................................................... 57
Table 4-38 J1939Dcm_GetNteStatus() ....................................................................... 58
Table 4-39 J1939Dcm_GetObdInformation() .............................................................. 58
Table 4-40 J1939Dcm_GetSupportedTestIdentifiers() ................................................ 59
Table 4-41 J1939Dcm_TestResultTxConfirmation().................................................... 60
Table 6-1 Supported hold signal states..................................................................... 63
Table 6-2 Meta Data content .................................................................................... 63
Table 6-3 Derivation of source and destination address ........................................... 64
Table 6-4 Supported Node / Channel combinations for DM22 .................................. 64
Table 6-5 Responses for DM11 requests in dependency of the parameter
J1939DcmObdSpecific ............................................................................. 65
Table 7-1 Glossary ................................................................................................... 66
Table 7-2 Abbreviations ............................................................................................ 67

© 2024 Vector Informatik GmbH Version 17.0.1 9


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

1 Introduction

This document describes the functionality, API and configuration of the AUTOSAR BSW
module J1939DCM as specified in [1].

Supported AUTOSAR Release*: 4


Supported Configuration Variants: pre-compile
Vendor ID: J1939DCM_VENDOR_ID 30 decimal
(= Vector-Informatik,
according to HIS)
Module ID: J1939DCM_MODULE_ID 58 decimal
(According to ref. [1][4])
* For the precise AUTOSAR Release 4.x please see the release specific documentation.

The J1939DCM handles the diagnostic communication in a J1939 network. SAE J1939-73
(see [6]) defines several so-called Diagnostic Messages (DMs) which are received and/or
transmitted over the network by the J1939DCM.

1.1 Architecture Overview


The following figure shows where the J1939DCM is located in the AUTOSAR architecture.

Figure 1-1 AUTOSAR 4.1 Architecture Overview

© 2024 Vector Informatik GmbH Version 17.0.1 10


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

The next figure shows the interfaces to adjacent modules of the J1939DCM.

Figure 1-2 Interfaces to adjacent modules of the J1939DCM

© 2024 Vector Informatik GmbH Version 17.0.1 11


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

2 Functional Description

2.1 Features
The following table gives an overview over the diagnostic messages which are defined by
AUTOSAR in [1] and which are supported by the J1939DCM.
Especially OBD related DMs are not yet supported, while the memory access messages
are implemented according to the SAE specification ([6]) but not yet defined by AUTOSAR.

Implemented by
Specified by

J1939DCM
AUTOSAR
Diagnostic Messages

DM1 – Active Diagnostic Trouble Codes  

DM2 – Previously Active Diagnostic Trouble Codes  

DM3 – Diagnostic Data Clear/Reset Of Previously Active DTCs  


 
DM4 – Freeze Frame Parameters
DM5 – Diagnostic Readiness 1  

DM6 – Pending DTCs  

DM7 – Command Non-Continuously Monitored Test 

DM8 – Test Results for Non-Continuously Monitored Systems 

DM10 – Non-Cont. Monitored Systems Test Identifiers Support 

DM11 – Diagnostic Data Clear/Reset For Active DTCs  


 
DM12 – Emissions-Related Active Diagnostic Trouble Codes
DM13 – Stop Start Broadcast  

DM14 – Memory Access Request 

DM15 – Memory Access Response 

DM16 – Binary Data Transfer 

DM17 – Boot Load Data 



DM18 – Security Data
DM19 – Calibration Information  

DM20 – Monitor Performance Ratio  

DM21 – Diagnostic Readiness 2  

DM22 – Individual Clear/Reset of Active and Previously Active 


DTC
DM23 – Previously Active Emission Related Faults  

DM24 – SPN Support  


 
DM25 – Expanded Freeze Frame

© 2024 Vector Informatik GmbH Version 17.0.1 12


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

DM26 – Diagnostic Readiness 3  

DM27 – All Pending DTCs 

DM28 – Permanent DTCs  

DM29 – DTC Counts  

DM30 – Scaled Test Results 


 
DM31 – DTC To Lamp Association
DM33 – EI-AECD Active Time 

DM34 – NTE Status 

DM35 – Immediate Fault Status  

DM53 – Active Service Only DTCs 

DM54 – Previously Active Service Only DTCs 



DM55 – Diagnostic Data Clear/Reset for All Service Only DTCs
DM56 – Model Year and Certification Engine Family 

DM57 – OBD Information 

DM58 – Rationality Fault SPN Data 

Table 2-1 Implemented Diagnostic Messages

Additional Features which are not related to a specific DM:


Additional Features
Communication State Handling
Table 2-2 Additional Features

2.1.1 Limitations
2.1.1.1 DM1 Transmission on DTC status change
Only the first status change of any DTC within a 1s period will lead to a DM1 transmission.
This is a limitation to the AUTOSAR and SAE specifications ([1] and [6]), where a DM1
shall be transmitted for the first status change of each DTC.
2.1.1.2 OBD Support
Only a limited number of OBD related diagnostic messages are supported (see Table 2-1).
2.1.1.3 Parallel Message Processing and Multiple Nodes
Generally, the J1939DCM is only able to process one message request at a time for each
node. Different nodes are handled independently, so it is possible to request a DM
simultaneously for two nodes.
However, parallel message processing on different nodes is limited. If an access to the
DEM takes longer than one task cycle, all further requests which require DEM access are
rejected.
In case of a directed request, the NACK “Cannot Respond” will be sent. According to the
specification of the Acknowledgment PGN 59392 in [7], the data must then be re-
requested later.

© 2024 Vector Informatik GmbH Version 17.0.1 13


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

For broadcast requests, where all configured nodes need to respond simultaneously, this
may have the effect that only the first node is able to respond.
2.1.1.4 DM13 and Multiple Nodes
DM13 only affects the configured channels, its implementation is completely independent
of the nodes.

2.2 Initialization
If not already done by the startup code, the statically initialized RAM variables must be
initialized by calling J1939Dcm_InitMemory.
The J1939DCM itself is initialized by calling J1939Dcm_Init. The module can be reset
with the J1939Dcm_DeInit. In uninitialized state, only the
J1939Dcm_GetVersionInfo API is available.

2.3 States
After it is initialized, the J1939DCM is by default in the state J1939DCM_OFFLINE. In this
state, requests can neither be received nor are messages transmitted. The state is
changed to J1939DCM_ONLINE by the API J1939Dcm_SetState.
Initial

startup code,
J1939Dcm_InitMemory
Initialized

Uninitialized OFFLINE ONLINE


J1939Dcm_Init
J1939Dcm_SetState [ONLINE]
notes notes
no diagnostic communication DM1 is sent periodically
J1939Dcm_SetState [OFFLINE]
J1939Dcm_DeInit DM requests are accepted

[pow er dow n]

[pow er dow n]

Final

Figure 2-1 J1939DCM Module States

2.4 Main Functionality


Basically, all functionalities of the J1939DCM are asynchronous. Within the context of each
API, the requested operation is queued and executed on task level. The basic
functionalities of the J1939DCM can be divided into four groups:
2.4.1 Transmission of requested Diagnostic Messages
Most diagnostic messages are requested using the J1939 Request PGN (PGN = 59904).
This PGN is handled by the J1939 Request Manager (see [4]) and forwarded to the

© 2024 Vector Informatik GmbH Version 17.0.1 14


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

J1939DCM through the API J1939Dcm_RequestIndication. Upon request, the


J1939DCM collects the according data and starts transmission.
2.4.2 Transmission of periodic messages
DM1 (always) and DM35 (on request) are transmitted periodically. The J1939DCM
regularly collects the related data and transmits the according DM over the bus as
broadcast messages.
2.4.2.1 ISOBUS channel
When a specific J1939Dcm channel is configured as ISOBUS, the periodic transmission of
DM1 via that very same channel is affected in such a way that the periodic transmission is
triggered only when an error is active. The activation of this feature can be done via
/J1939Dcm/J1939DcmConfigSet/J1939DcmChannel/J1939DcmIsobusChannel.
2.4.3 Communication State Handling
Besides the ONLINE / OFFLINE state (see 2.3), SAE also specifies the possibility to
enable or disable transmission of broadcast messages. This is done through DM13, which
can be received by the J1939DCM. A change of the broadcast status is then forwarded to
the BswM (API BswM_J1939DcmBroadcastStatus).
2.4.3.1 DM13 and Broadcast-Command prioritization
The first three bytes of DM13 payload consist of twelve 2-bit groups. Each of these 2-bit
groups controls the broadcast command of a specific network. The twelve networks can be
classified as one "current" network and another eleven "distinct" networks. The "current"
network is the one where the DM13 message was actually received from. It is identical to
one of the other eleven "distinct" networks.
If the 2-bit group values (broadcast commands) of the "current" network and the
corresponding "distinct" network are different, then the J1939Dcm prioritizes the broadcast
command of the "current" network not considering the value of the "distinct" network
according to the following table:
Current network Distinct network Broadcast command
00 (Stop Broadcast) Not evaluated 00 (Stop Broadcast)
01 (Start Broadcast) Not evaluated 01 (Start Broadcast)
11 (leave as is) 00 (Stop Broadcast) 00 (Stop Broadcast)
11 (leave as is) 01 (Start Broadcast) 01 (Start Broadcast)
11 (leave as is) 11 (leave as is) 11 (leave as is)
Table 2-3 Broadcast-Command prioritization

2.4.4 Memory Access


SAE J1939-73 ([6]) defines DM14 through DM18 to allow a tester to access the memory of
an ECU. These messages are supported by the J1939DCM and forwarded to the
application, by which the memory access operation is handled.

© 2024 Vector Informatik GmbH Version 17.0.1 15


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

2.5 Error Handling


2.5.1 Development Error Reporting
By default, development errors are reported to the DET using the service
Det_ReportError() as specified in [2], if development error reporting is enabled (i.e.
pre-compile parameter J1939DCM_DEV_ERROR_DETECT == STD_ON).
The reported service IDs identify the services which are described in 4.2. The following
table presents the service IDs and the related services:

Service ID Service
0x01 J1939Dcm_Init
0x02 J1939Dcm_DeInit
0x03 J1939Dcm_GetVersionInfo
0x04 J1939Dcm_MainFunction
0x0A J1939Dcm_DemTriggerOnDTCStatus
0x0B J1939Dcm_SetState
0x40 J1939Dcm_TxConfirmation
0x42 J1939Dcm_RxIndication
0x43 J1939Dcm_CopyTxData
0x44 J1939Dcm_CopyRxData
0x45 J1939Dcm_TpRxIndication
0x46 J1939Dcm_StartOfReception
0x47 J1939Dcm_RequestIndication
0x48 J1939Dcm_TpTxConfirmation
0x50 J1939Dcm_MemResponseTransmit
0x51 J1939Dcm_MemDataTransmit
0x52 J1939Dcm_ProvideTestResultOfDm8
0x80 J1939Dcm_InitMemory
Table 2-4 Service IDs

If another module is used for development error reporting, the function prototype for
reporting the error can be configured by the integrator but must have the same signature
as the service Det_ReportError().
The reported J1939DCM ID is 58.
The errors reported to DET are described in the following table:
Error Code Description
0x01 J1939DCM_E_INVALID_PDU_SDU_ID API called with invalid PDU-ID
0x06 J1939DCM_E_INVALID_STATE API called although not allowed in
current state (e.g. in OFFLINE state)
0x07 J1939DCM_E_PARAM_ID API called with invalid parameter

© 2024 Vector Informatik GmbH Version 17.0.1 16


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

0x08 J1939DCM_E_INVALID_NODE API called with invalid node identifier


0x0A J1939DCM_E_INVALID_PRIO API called with invalid priority
0x0B J1939DCM_E_INVALID_CHANNEL API called with invalid channel
identifier
0x0D J1939DCM_E_INVALID_PGN API called with invalid PGN
0x0E J1939DCM_E_BUFFER_TOO_SMALL API called with insufficient buffer
0x11 J1939DCM_E_PARAM_POINTER API called with invalid pointer
parameter
0x14 J1939DCM_E_INIT_FAILED Calling J1939Dcm_Init failed
0x20 J1939DCM_E_UNINIT API called although J1939DCM is not
initialized
0x21 J1939DCM_E_REINIT J1939Dcm_Init have been called
although module is already initialized
0x22 J1939DCM_E_INTERFACE_RETURN_VALUE The return value of called API is out of
range.
0x31 J1939DCM_E_OVERRUN Task overrun detected
0x32 J1939DCM_E_PARAM_CONFIG Configuration does not allow desired
operation
0x33 J1939DCM_E_INVALID_DESTINATION_ADDRESS DM7 is requested with global
destination address.
0xFF J1939DCM_E_NO_ERROR Used for local variables initialization
Table 2-5 Errors reported to DET

2.6 Deviations
The following features specified in [1] are not supported:
Category Description
Functional J1939DcmGenericDMxSupport is not supported. Therefore, the following API
API functions and configuration parameters are not available:
Config API functions:
- J1939Dcm_GenericDMxTransmit
- GenericDMx…
Configuration parameters:
- J1939DcmGenericDMx…
Functional Mode Rules and Mode Conditions are not supported. Therefore, the following
Config configuration containers / parameters are not available:
- J1939DcmDiagnosticMessageModeRuleRef
- J1939DcmProcessingConditions and all sub containers
- J1939DcmModeCondition and all sub containers
Functional A negative acknowledgement is sent in case PduR_J1939DcmTransmit returns
anything but E_OK instead of retrying the failed transmission from the next main
function.

© 2024 Vector Informatik GmbH Version 17.0.1 17


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

API If the function J1939Dcm_TxConfirmation is called during a TP transmission, the


transmission of TP is confirmed instead returning without any effect. DET with
J1939DCM_E_INVALID_STATE is not triggered.
API The parameter TpSduLength is not checked in API function
J1939Dcm_StartOfReception.
API If the API function J1939Dcm_CopyTxData is called with different TxPduIds, neither
DET error J1939DCM_E_INVALID_STATE is reported nor BUFREQ_E_NOT_OK is
returned.
Config The following configuration parameters are not supported:
- J1939DcmDM35BufferSize
- J1939DcmServiceOnlyDTCsMemoryDestinationRef
Config Sender-Receiver Communication is not supported. Therefore, the configuration
container J1939DcmDspExternalSRDataElementClass and all sub containers are
not supported.
Table 2-6 Not supported features

The following features specified in [1] are supported with deviations:


Category Description
Functional For Service Only DTCs (used in DM53, DM54 and DM55) the DTCOrigin
DEM_DTC_ORIGIN_SECONDARY_MEMORY is used instead of
J1939DcmServiceOnlyDTCsMemoryDestinationRef.
Functional No separate DM01 buffer is available and therefore no additionally DM01 message
(additionally to the regular periodic transmission) can be transmitted when DEM calls
J1939Dcm_DemTriggerOnDTCStatus.
Functional For DM01 messages the required time interval between packets of a multipacket
BAM message is 10 to 50 ms. In each package of 8 bytes, 2 DTCs can be inserted.
If the number of DTCs is greater than 40 ... 100 (depending on the configured
timeout), the one second will be exceeded.
Functional For Diagnostic message 35 (DM35) J1939DcmCommonBufferSize is used instead of
J1939DcmDM35BufferSize.
API The DET error J1939DCM_E_INVALID_STATE is not reported if the combination of
node and channel is offline for the following API functions:
- J1939Dcm_RequestIndication
- J1939Dcm_RxIndication
- J1939Dcm_TxConfirmation
- J1939Dcm_StartOfReception
API If the API function J1939Dcm_TpTxConfirmation is called out of context (J1939Dcm
is currently transmitting a response message over TP protocol), no DET error
J1939DCM_E_INVALID_STATE is not reported.
API Following API functions have deviations for the used parameters:
- J1939Dcm_TxConfirmation (parameter result is not available)
- J1939Dcm_StartOfReception (parameter info is not const)
- J1939Dcm_CopyRxData (parameter info is not const)
- J1939Dcm_CopyTxData (parameters info and retry are not const)

© 2024 Vector Informatik GmbH Version 17.0.1 18


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Config Buffer size in configuration parameter J1939DcmDM01BufferSize is limited to 1785


bytes, because the longest possible size is limited by J1939TP.
Functional J1939Dcm_GetCalibrationVerificationNumber does not use the port interface
J1939Dcm_CalibrationInformation. J1939Dcm_GetCalibrationVerificationNumber is
implemented as a Call-out to application.
Table 2-7 Supported features with deviations

2.6.1 Interaction with MICROSAR Classic DEM when OBDII is licensed

Caution
Some of the diagnostic messages needs interaction with DEM (see 4.3 Services used
by J1939DCM). If both, J1939 and OBDII, are licensed for DEM, only the interaction for
diagnostic messages DM01, DM02, DM05, DM11, DM22, DM25 and DM27 are
handled correctly by MICROSAR Classic DEM. The following diagnostic messages
which also require an interaction with DEM may be rejected or the response message
may be incorrect:
- DM03, DM04, DM31, DM35, DM53, DM54 and DM55
Other diagnostic messages which require no interaction with DEM are not affected by
this restriction.

© 2024 Vector Informatik GmbH Version 17.0.1 19


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

3 Integration

This chapter gives necessary information for the integration of the MICROSAR Classic
J1939DCM into an application environment of an ECU.

3.1 Scope of Delivery


The delivery of the J1939DCM contains the files which are described in the chapters 3.1.1
and 3.1.2:
3.1.1 Static Files

File Name Description


J1939Dcm.c Source file of the J1939DCM implementation
J1939Dcm.h Main header file which shall be included by modules using the J1939DCM
J1939Dcm_Priv.h Module internal definitions
J1939Dcm_Types.h Module specific type definitions
J1939Dcm_Cbk.h Prototypes of callbacks provided by the J1939DCM
Table 3-1 Static files

3.1.2 Dynamic Files


The dynamic files are generated by the DaVinci Configurator configuration tool.
File Name Description
J1939Dcm_Cfg.h Precompile definitions
J1939Dcm_Lcfg.c Configurations tables which can only be changed at link time
J1939Dcm_Lcfg.h Data prototypes for link time configuration tables
J1939Dcm_PBcfg.c Configurations tables which may be changed at post-build time
J1939Dcm_PBcfg.h Data prototypes for post build configuration tables
J1939Dcm_MemMap.h Memory mapping for J1939Dcm
Table 3-2 Generated files

© 2024 Vector Informatik GmbH Version 17.0.1 20


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

3.1.3 Include Structure


J1939DCM

J1939Dcm_Priv.h J1939Dcm.c Det.h


«include» «include»

«include»
Bsw M.h
«include»

J1939Dcm_Lcfg.c J1939Dcm_PBcfg.c «include» «include»


SchM_J1939Dcm.h
«include»

«include»
J1939Dcm.h PduR_J1939Dcm.h
«include» «include»

«include» «include» «include»


J1939Rm.h

J1939Dcm_Lcfg.h J1939Dcm_PBcfg.h J1939Dcm_Cbk.h


«include»
Dem_J1939Dcm.h

«include» «include» «include» «include»

J1939Dcm_Cfg.h J1939Dcm_Types.h ComStack_Types


«include» «include»

Figure 3-1 J1939DCM Include Structure

3.2 Critical Sections


As the J1939DCM handles all external requests on task level, the requests from APIs must
be queued. Whenever the content of a queue is changed, the J1939DCM uses the critical
section J1939DCM_EXCLUSIVE_AREA_0 to ensure data consistency.
The following APIs may use this critical section:
> J1939Dcm_Init
> J1939Dcm_DeInit
> J1939Dcm_MainFunction
> J1939Dcm_SetState
> J1939Dcm_RequestIndication
> J1939Dcm_RxIndication
> J1939Dcm_TxConfirmation
> J1939Dcm_StartOfReception
> J1939Dcm_CopyRxData
> J1939Dcm_TpRxIndication
> J1939Dcm_CopyTxData
> J1939Dcm_TpTxConfirmation
> J1939Dcm_DemTriggerOnDTCStatus

© 2024 Vector Informatik GmbH Version 17.0.1 21


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

> J1939Dcm_MemResponseTransmit
> J1939Dcm_MemDataTransmit
> J1939Dcm_ProvideTestResultOfDm8
> J1939Dcm_ProvideTestResultOfDm30
> J1939Dcm_ProvideTestResultOfDm58
The exclusive area can be omitted if it is guaranteed that all of these APIs are only called
in the same context and cannot interrupt each other (e.g. when polling is used).

3.3 Memory Access


For memory access operations, the SAE J1939 specification defines the following
diagnostic messages:
> DM14: Memory Access Request
> DM15: Memory Access Response
> DM16: Binary Data Transfer
> DM17: Boot Load Data
> DM18: Data Security
How these messages must be used is described in Appendix C of [6] and highly depends
on the needs of a specific use case. Therefore, the memory access handling itself have to
be done by the application, e.g. by a complex device driver.
The J1939DCM only provides interfaces (APIs and call-outs to the application) for
message reception and transmission. The following table gives an overview over these
interfaces:

Interface / Function Pointer Definition Type Usage


J1939Dcm_MemRequestRxFuncType Call-out Reception of DM14
J1939Dcm_MemResponseTransmit API Transmission of DM15
J1939Dcm_MemResponseTxConfFuncType Call-out TxConfirmation for DM15
J1939Dcm_MemDataRxStartFuncType Call-out Reception of DM16 and DM18
J1939Dcm_MemDataRxCopyFuncType Call-out Reception of DM16 and DM18
J1939Dcm_MemDataRxIndFuncType Call-out Reception of DM16, DM17 and DM18
J1939Dcm_MemDataTransmit API Transmission of DM16 and DM18
J1939Dcm_MemDataTxConfFuncType Call-out TxConfirmation for DM16 and DM18
Table 3-3 Memory Access Interfaces provided by J1939DCM

The call-outs must be specified in the configuration tool and implemented in the application
according to chapter 4.5.1
Also a header file with the prototypes of the implemented functions has to be provided. It is
specified via the configuration parameter

© 2024 Vector Informatik GmbH Version 17.0.1 22


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

> J1939DcmMemAccessHeaderFile
3.3.1 Memory Access Request (DM14)
DM14 is used by a diagnostic tool to request memory access, so the message only needs
to be received.
The J1939DCM directly forwards a reception of DM14 to the application. The function
which shall be used for notification is set by the configuration parameter:
 J1939DcmMemRequestIndicationFunc

CAN Bus Routine Memory Access


J1939DcmMemRequestIndicationFunc CDD
J1939Dcm_RxIndication

DM14 received()

Figure 3-2 Memory Access: DM14 Reception Sequence

3.3.2 Memory Access Response (DM15)


DM15 is used by the ECU to respond to a memory access request, so the message only
need to be transmitted.
Transmission of DM15 is triggered through J1939Dcm_MemResponseTransmit().
The subsequent TxConfirmation is directly forwarded to the application. The function which
shall be used for notification is set by the configuration parameter:
> J1939DcmMemResponseTxConfFunc

CAN Bus Routine Routine Memory Access


J1939DcmMemResponseTxConfFunc CDD
J1939Dcm_TxConfirmation J1939Dcm_MemResponseTransmit

start transmission()

transmission complete()

Figure 3-3 Memory Access: DM15 Transmission Sequence

3.3.3 Binary Data Transfer (DM16)


DM16 is used to transfer binary data between the ECU and the diagnostic tool. Therefore,
it may be received or transmitted.
On reception, the J1939DCM directly forwards all TP API calls to the application. For this,
three function must be provided which are set by the following configuration parameters:

© 2024 Vector Informatik GmbH Version 17.0.1 23


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

> J1939DcmMemDataStartOfReceptionFunc
> J1939DcmMemDataCopyRxFunc
> J1939DcmMemDataRxIndicationFunc
CAN Bus Routine Routine Routine Memory Access
J1939DcmMemDataStartOfReceptionFunc
J1939DcmMemDataCopyRxFunc J1939DcmMemDataRxIndicationFunc CDD
J1939Dcm_StartOfReception J1939Dcm_CopyRxData J1939Dcm_TpRxIndication

reception started()

loop until all data received

copy Rx data()

reception finished()

Figure 3-4 Memory Access: DM16 Reception Sequence

Transmission of DM16 is triggered through J1939Dcm_MemDataTransmit(). Based on


the PduInfo parameter of this API, the J1939DCM will also handle the CopyTxData calls of
the TP. Therefore, it is important that the application locks the buffer which is passed with
the transmit request until the TxConfirmation occurs.
The TxConfirmation is directly forwarded to the application. The function which shall be
used for notification is set by the configuration parameter:
> J1939DcmMemDataTxConfFunc
CAN Bus Routine Routine Routine Memory Access
J1939DcmMemDataTxConfFunc CDD
J1939Dcm_TpTxConfirmation J1939Dcm_CopyTxData J1939Dcm_MemDataTransmit

start transmission()

loop until all data transm itted

transmission complete()

Figure 3-5 Memory Access: DM16 Transmission Sequence

Because all functions (for reception and transmission) are shared by DM16, DM17 and
DM18, each API has a DataKind parameter which depends on the according message
contents.
For DM16, this parameter is set to J1939DCM_MEM_DATA_BINARY.

© 2024 Vector Informatik GmbH Version 17.0.1 24


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

3.3.4 Boot Load Data (DM17)


DM17 is used to transfer boot load data to an ECU, so the message only needs to be
received.
The J1939DCM directly forwards a reception of DM17 to the application. The function
which shall be used for notification is set by the configuration parameter:
> J1939DcmMemDataRxIndicationFunc
CAN Bus Routine Memory Access
J1939DcmMemDataRxIndicationFunc CDD
J1939Dcm_RxIndication

[J1939DCM_MEM_DATA_BOOTLOAD]:

DM17 received()

Figure 3-6 Memory Access: DM17 Reception Sequence

Because the function is shared by DM16, DM17 and DM18, it has a DataKind parameter
which depends on the according message contents.
For DM17, this parameter is set to J1939DCM_MEM_DATA_BOOTLOAD.
3.3.5 Data Security (DM18)
DM18 is used to transfer security keys and seeds between the ECU and the diagnostic
tool, so it may be received or transmitted.
Reception and transmission works the same way as for DM16 (see 3.3.3, Figure 3-4 and
Figure 3-5).
For DM18, the DataKind parameter provided by each function, is set to
J1939DCM_MEM_DATA_SECURITY.

3.4 Access to Application


The following diagnostic messages need access to the application:
> DM7: Command Non-Continuously Monitored Test
> DM8: Test Results for Non-Continuously Monitored Systems
> DM10: Non-Continuously Monitored Systems Test Identifiers Support
> DM19: Calibration Information
> DM30: Scaled Test Results
> DM33: EI-AECD Active Time
> DM56: Model Year and Certification Engine Family
> DM57: OBD Information
> DM58: Rationality Fault SPN Data

© 2024 Vector Informatik GmbH Version 17.0.1 25


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

For these diagnostic messages the J1939DCM provides interfaces (APIs and call-outs to
the application). The following table gives an overview over these interfaces

Interface / Function Pointer Definition Type Usage


J1939Dcm_ExecuteTest Call-out Triggers the execution of a test for
DM7
J1939Dcm_GetCalibrationVerificationNumber Call-out Read out the calibration
information for DM19
J1939Dcm_GetDeviceActiveTime Call-out Read out the EI-AECD Active Time
for DM33
J1939Dcm_GetModelYear Call-out Read out the Model Year and the
Certification Engine Family for
DM56
J1939Dcm_GetNteStatus Call-out Read out the NTE Status for DM34
J1939Dcm_GetObdInformation Call-out Read out the OBD Information for
DM57
J1939Dcm_GetSupportedTestIdentifiers Call-out Read out the supported Non-
Continuously Monitored Systems
Test Identifiers for DM10
J1939Dcm_ProvideTestResultOfDm8 API Provide test result for Non-
Continuously Monitored Systems
for DM8
J1939Dcm_ProvideTestResultOfDm30 API Provide Scaled Test Results for
DM30
J1939Dcm_ProvideTestResultOfDm58 API Provide test result for Non-
Continuously Monitored Systems
for DM58
J1939Dcm_TestResultTxConfirmation Call-out Informs the application about the
transmission result of DM8 / DM58
message
Table 3-4 Application Interface provided by J1939DCM

The call-outs must be implemented in the application according to chapter 4.5.2


3.4.1 Command Non-Continuously Monitored Test (DM7)
DM7 is used to Command manufacturer specific tests, Command standard tests (if
applicable), or Command to return last measured scaled results. The J1939DCM directly
forwards the parameters received from CanIf to the application by calling the call-out
function J1939Dcm_ExecuteTest().

© 2024 Vector Informatik GmbH Version 17.0.1 26


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Figure 3-7 Command Non-Continuously Monitored Test: DM7 Sequence

3.4.2 Provide test result for Non-Continuously Monitored Systems (DM8)


DM8 is used to report the test results for one of the non-continuously monitored tests
invoked using DM7. The J1939DCM directly forwards the test results provided by the call
to the API J1939Dcm_ProvideTestResultOfDm8() to the diagnostic tool via J1939Tp. The
application is informed about the result of the transmission of the DM8 by the call-out
J1939Dcm_TestResultTxConfirmation().

Figure 3-8 Provide test result for Non-Continuously Monitored Systems: DM8 Sequence

© 2024 Vector Informatik GmbH Version 17.0.1 27


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

3.4.3 Supported Non-Continuously Monitored Systems Test Identifiers (DM10)


DM10 is used to report the Supported Non-Continuously Monitored Systems Test
Identifiers. The J1939DCM directly forwards a reception of DM10 to the application. When
the Supported Non-Continuously Monitored Systems Test Identifiers are gathered from the
application the J1939DCM will trigger the transmission to the diagnostic tool via CanIf.

Figure 3-9 Supported Non-Continuously Monitored Systems Test Identifiers: DM10 Sequence

3.4.4 Read out of Calibration Information (DM19)


DM19 is used by a diagnostic tool to request calibration information from the application.
The J1939DCM directly forwards a reception of DM19 to the application. When all
calibration information is gathered from the application the J1939DCM will trigger the
transmission to the diagnostic tool via J1939Tp.

Figure 3-10 Calibration Information: DM19 Sequence

3.4.5 Provide Scaled Test Results (DM30)


DM30 is used to report Scaled Test Results invoked using DM7. The J1939DCM directly
forwards the test results provided by the call to the API

© 2024 Vector Informatik GmbH Version 17.0.1 28


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

J1939Dcm_ProvideTestResultOfDm30() to the diagnostic tool via J1939Tp. The


application is informed about the result of the transmission of the DM30 by the call-out
J1939Dcm_TestResultTxConfirmation().

Figure 3-11 Provide Scaled Test Results: DM30 Sequence

3.4.6 Read out EI-AECD Activation Time (DM33)


DM33 is used by a diagnostic tool to request EI-AECD Activation Time from the
application. The J1939DCM directly forwards a reception of DM33 to the application.
When all EI-AECD Activation Times are gathered from the application the J1939DCM will
trigger the transmission to the diagnostic tool via J1939Tp.

Figure 3-12 EI-AECD Activation Time: DM33 Sequence

3.4.7 NTE Status (DM34)


DM34 is used by a diagnostic tool to request the NTE Status from the application. The
J1939DCM directly forwards a reception of DM34 to the application. When the NTE Status

© 2024 Vector Informatik GmbH Version 17.0.1 29


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

is received from the application the J1939DCM will trigger the transmission to the
diagnostic tool via J1939Tp.

Figure 3-13 NTE Status: DM34 Sequence

3.4.8 Model Year and Certification Engine Family (DM56)


DM56 is used by a diagnostic tool to request the Model Year and Certification Engine
Family from the application. The J1939DCM directly forwards a reception of DM56 to the
application. When the Model Year and Certification Engine Family is provided by the
application, the J1939DCM will trigger the transmission to the diagnostic tool via J1939Tp.

Figure 3-14 Model Year and Certification Engine Family: DM56 Sequence

3.4.9 OBD Information (DM57)


DM57 is used by a diagnostic tool to request the OBD Information from the application.
The J1939DCM directly forwards a reception of DM57 to the application. When the OBD
Information is provided by the application, the J1939DCM will trigger the transmission to
the diagnostic tool via J1939Tp.

© 2024 Vector Informatik GmbH Version 17.0.1 30


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Figure 3-15 OBD Information: DM57 Sequence

3.4.10 Provide test result for Rationality Fault SPN Data (DM58)
DM58 is used to report Rationality Fault SPN Data invoked using DM7. The J1939DCM
directly forwards the test results provided by the call to the API
J1939Dcm_ProvideTestResultOfDm58() to the diagnostic tool via J1939Tp. The
application is informed about the result of the transmission of the DM58 by the call-out
J1939Dcm_TestResultTxConfirmation().

Figure 3-16 Provide test result for Rationality Fault SPN Data: DM58 Sequence

3.5 Post-build Modes


3.5.1 Post-build Selectable
Via the post-build selectable, different variants can be flashed in an ECU at the build time
where only one of which shall be activated at a specific moment. None of the flashed
variants can be altered in the post-build time. For more information, please refer to [9].

© 2024 Vector Informatik GmbH Version 17.0.1 31


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

3.5.2 Post-build Loadable


Post-build loadable helps to modify an existing variant in the post-build time (post-compile
time). For more information, please refer to [8].
3.5.3 Post-build Loadable Selectable
The features of both modes selectable and loadable are combined. Therefore, in the run
time, a variant can be selected using post-build selectable and then updated using post-
build loadable. For more information, please refer to 3.5.1 and 3.5.2.
3.5.4 Post-build Deletable
It helps to delete parameters that were created at the link time. This feature is considered
also as a part of the post-build Loadable. For more information, please refer to [8].
3.5.5 Configuration
When post-build loadable is activated, all supported DMs will be activated as well even if
they are not configured. Therefore, to avoid compiler errors, make sure to configure both
containers /J1939Dcm/J1939DcmGeneral/J1939DcmMemAccessFunctions, (e.g. Figure
3-17) and /Dem/DemGeneral/DemGeneralJ1939, (e.g. Figure 3-18) in the precompile
phase as if all the supported DMs are configured. Those two containers are not post-build
capable. Therefore, they must be configured in the precompile phase for example as given
below:

Figure 3-17 Configuration of J1939DcmMemAccessFunctions for post-build loadable

© 2024 Vector Informatik GmbH Version 17.0.1 32


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Figure 3-18 Configuration of DemGeneralJ1939 for post-build loadable

As a precaution, a validation rule is implemented in DaVinci Configurator to assure that the


container J1939DcmMemAccessFunctions is configured when the configuration mode is
set to post-build loadable.
3.5.6 Post-build Capable Containers
3.5.6.1 Diagnostic Messages
The diagnostic message container is post-build capable. Therefore, it can be added or
deleted in the post-build phase. A diagnostic message container is a single instance of the
diagnostic message. Each of the diagnostic message containers (diagnostic message
instances) is defined in a specific node and references a specific channel. Deleting a
single container of the diagnostic message does not mean the whole message is deleted.
To delete a diagnostic message, all instances of this particular message have to be
deleted from all configured nodes.
3.5.6.2 Channels
Channels are post-build capable but with some restrictions. On one hand, Channels
cannot be added or deleted in the post-build phase. Therefore, it must be known from the
precompile time how many channels shall be needed. DaVinci Configurator optimizes the
generated code. If a channel is not being referenced by any diagnostic message, the
channel shall not be generated.
On the other hand, the ComM channel that is referenced by J1939DCM channel
(1939DcmComMChannelRef), the bus type in which a J1939DCM channel shall be
activated (1939DcmBusType), and the affiliation of the channel to ISOBUS
(J1939DcmIsobusChannel) are post-build capable.
3.5.6.3 Nodes
Nodes are not post-build capable. However, SPNs are post-build capable. Therefore,
SPNs can be added or deleted in the post-build phase. SPNs are solely node dependent.

© 2024 Vector Informatik GmbH Version 17.0.1 33


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4 API Description

For an overview of all interfaces please see Figure 1-2: Interfaces to adjacent modules of
the J1939DCM.

4.1 Type Definitions


The types defined by the J1939DCM are described in this chapter.
Type Name Description Value Range
J1939Dcm_StateType This type 0 = J1939DCM_STATE_ONLINE
represents the 1 = J1939DCM_STATE_OFFLINE
communication
state of the
J1939DCM.
J1939DcmBusType Possible bus 0 = J1939DCM_CURRENT_NETWORK
types for a 1 = J1939DCM_J1587
J1939DCM 2 = J1939DCM_J1922
channel.
3 = J1939DCM_J1939_NETWORK_1
The definition is
derived from the 4 = J1939DCM_J1939_NETWORK_2
bit order in the 5 = J1939DCM_ISO9141
DM13 message 6 = J1939DCM_J1850
7 = J1939DCM_OTHER
8 = J1939DCM_J1939_NETWORK_3
9 =
J1939DCM_PROPRIETARY_NETWORK_1
10 =
J1939DCM_PROPRIETARY_NETWORK_2
11 = J1939DCM_J1939_NETWORK_4
J1939Dcm_MemDataType Data content for 16 = J1939DCM_MEM_DATA_BINARY
memory access 17 =
messages to be J1939DCM_MEM_DATA_BOOTLOAD
received or 18 =
transmitted J1939DCM_MEM_DATA_SECURITY
J1939Dcm_EngineWarmupSequenceType Engine warm- 0 =
up as defined J1939DCM_WARMUP_NOT_OCCURED
by the 1 = J1939DCM_WARMUP_OCCURED
applicable 3 =
region's J1939DCM_WARMUP_NOT_SUPPORTED
regulatory
agency
Std_ReturnType Standard return 0 = E_OK
type of the 2 = J1939DCM_E_NEXT
application 3 = J1939DCM_E_NOT_READY
callouts used by
10 = J1939DCM_E_BUSY
the J1939Dcm
Table 4-1 Enumeration type definitions

© 2024 Vector Informatik GmbH Version 17.0.1 34


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Type Name Description Struct Members


J1939Dcm_AddressInfoType Addressing information for reception ChannelId
and transmission. It contains the SourceAddress
ComM Channel Id and the J1939Nm DestinationAddress
Addresses.
J1939Dcm_MemReqParamType Parameters of a received DM14 Length
message. For detailed definition, Command
see [6]. Pointer
PointerType
Pointer Extension
Key
J1939Dcm_MemRespParamType Parameters of a DM15 message to Length
be transmitted. For detailed Status
definition, see [6]. EDCPExtension
ErrorIndicator
Seed
J1939Dcm_NteStatusType NOx and PM NTE Status. NoxStatus
PmStatus
Table 4-2 Structure type definitions

4.1.1 J1939Dcm_CalibrationIDArrayType
Type Name C-Type Description Value Range
J1939Dcm_Calibrati uint8* Calibration ASCII and limited to printable
onIDArrayType identification characters only, except that 0016 used
as padding at the end for a CAL ID less
than 16 bytes.
Table 4-3 J1939Dcm_CalibrationIDArrayType

4.1.2 J1939Dcm_CertificationEngineFamilyNameType
Type Name C-Type Description Value Range
J1939Dcm_Certifica uint8* Certification Engine ASCII and limited to printable
tionEngineFamilyNa Family characters only, except that 0016 used
meType as terminating “null” character. Up to
200 characters may be used.
Table 4-4 J1939Dcm_CertificationEngineFamilyNameType

4.1.3 J1939Dcm_ModelYearType
Type Name C-Type Description Value Range
J1939Dcm_ModelY uint8* Model Year ASCII and limited to printable
earType characters only. Exactly 8 characters
must be provided by the application.
Table 4-5 J1939Dcm_ModelYearType

© 2024 Vector Informatik GmbH Version 17.0.1 35


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4.1.4 J1939Dcm_SupportedTestIdentifiersType
Type Name C-Type Description Value Range
J1939Dcm_Support uint8* Supported Test Indicates the test identifiers that the
edTestIdentifiersTyp Identifiers controller supports. Each bit is assigned
e to one test. The application must
provide exactly 8 Bytes.
Table 4-6 J1939Dcm_SupportedTestIdentifiersType

4.2 Services provided by J1939DCM


4.2.1 J1939Dcm_RequestIndication()
Prototype
void J1939Dcm_RequestIndication ( uint8 node,
NetworkHandleType channel,
uint32 requestedPgn,
J1939Rm_ExtIdInfoType* extIdInfo,
uint8 sourceAddress,
uint8 destAddress,
uint8 priority )
Parameter
node Node which received the request.
channel Channel on which the request was received.
requestedPgn PGN of the requested PG.
extIdInfo Extended identifier bytes.
sourceAddress Address of the node that sent the Request PG.
destAddress Address of this node or 0xFF for broadcast.
priority Priority of the Request PG.
Return code
void N/A
Functional Description
Indicates reception of a Request PG.
Particularities and Limitations
> Service ID = 0x47
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context (is usually called by J1939Rm)
Table 4-7 J1939Dcm_RequestIndication()

4.2.2 J1939Dcm_DeInit()
Prototype
void J1939Dcm_DeInit ( void )

© 2024 Vector Informatik GmbH Version 17.0.1 36


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Parameter
N/A N/A
Return code
void N/A
Functional Description
This function resets the J1939 Diagnostic Communication Manager to the uninitialized state.
Particularities and Limitations
> Service ID = 0x02
> This function is not reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-8 J1939Dcm_DeInit()

4.2.3 J1939Dcm_GetVersionInfo()
Prototype
void J1939Dcm_GetVersionInfo ( Std_VersionInfoType * versioninfo )
Parameter
versioninfo Pointer to address where the version information of the module will be stored.
Return code
void N/A
Functional Description
This function returns the version information of the J1939Dcm module.
The version information includes Module Id, Vendor Id and Vendor specific version numbers.
The version numbers are BCD-coded.
Particularities and Limitations
> Service ID = 0x03
> This function is not reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-9 J1939Dcm_GetVersionInfo()

4.2.4 J1939Dcm_Init()
Prototype
void J1939Dcm_Init ( const J1939Dcm_ConfigType* configPtr )
Parameter
configPtr Pointer to selected configuration structure.

© 2024 Vector Informatik GmbH Version 17.0.1 37


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Return code
void N/A
Functional Description
This function initializes the J1939 Diagnostic Communication Manager.
Particularities and Limitations
> Service ID = 0x01
> This function is not reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-10 J1939Dcm_Init()

4.2.5 J1939Dcm_InitMemory()
Prototype
void J1939Dcm_InitMemory ( void )

Parameter
N/A N/A
Return code
void N/A
Functional Description
This function can be used to initialize RAM variables which are part of a VAR_INIT memory section, if this
is not done by the startup code.
Particularities and Limitations
> Service ID = 0x80
> This function is reentrant
> This function is synchronous
Call context
> If this function is needed, it shall be called at startup before J1939Dcm_Init
Table 4-11 J1939Dcm_InitMemory()

4.2.6 J1939Dcm_MainFunction()
Prototype
void J1939Dcm_MainFunction ( void )
Parameter
N/A N/A
Return code
void N/A

© 2024 Vector Informatik GmbH Version 17.0.1 38


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Functional Description
Main function of the J1939 Diagnostic Communication Manager. Used for scheduling purposes and timeout
supervision.
Particularities and Limitations
> Service ID = 0x04
> This function is not reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-12 J1939Dcm_MainFunction()

4.2.7 J1939Dcm_SetState()
Prototype
Std_ReturnType J1939Dcm_SetState ( NetworkHandleType channel,
uint8 node,
J1939Dcm_StateType newState )
Parameter
channel Channel for which the state shall be changed.
note Node for which the state shall be changed.
newState New state the J1939DCM shall enter; see definition of
J1939Dcm_StateType for available states.

Return code
Std_ReturnType > E_OK: New communication state was set.
> E_NOT_OK: Communication state was not changed due to wrong value in
NewState or wrong initialization state of the module.
Functional Description
Changes the communication state of J1939DCM to offline or online.
Particularities and Limitations
> Service ID = 0x0B
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-13 J1939Dcm_SetState()

4.2.8 J1939Dcm_MemResponseTransmit()
Prototype
Std_ReturnType J1939Dcm_MemResponseTransmit (
J1939Dcm_AddressInfoType* AddressInfo,
J1939Dcm_MemRespParamType* MemResponseParameter )

© 2024 Vector Informatik GmbH Version 17.0.1 39


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Parameter
AddressInfo Source / Destination Address and Channel of message to be transmitted.
MemRequestInfo Parameters of the DM15 message to be transmitted.
Return code
Std_ReturnType > E_OK: transmission of DM15 has been started.
> E_NOT_OK: transmission of DM15 failed.
Functional Description
Triggers transmission of a Memory Access Response message (DM15).
When transmission is finished, the function configured as J1939DcmMemResponseTxConfFunc is called.
Particularities and Limitations
> Service ID = 0x50
> This function is not reentrant
> This function is asynchronous
> This function is only available if at least one DM15 message is configured
Call context
> This function can be called from any context
Table 4-14 J1939Dcm_MemResponseTransmit()

4.2.9 J1939Dcm_MemDataTransmit()
Prototype
Std_ReturnType J1939Dcm_MemDataTransmit (
J1939Dcm_MemDataType DataKind,
J1939Dcm_AddressInfoType* AddressInfo,
PduInfoType* PduInfo )
Parameter
DataKind Kind of data to be transmitted; allowed values are:
> J1939DCM_MEM_DATA_BINARY
> J1939DCM_MEM_DATA_SECURITY
AddressInfo Source / Destination Address and Channel of message to be transmitted.
PduInfo Data to be transmitted, specified by pointer and length.
Return code
Std_ReturnType > E_OK: transmission has been started.
> E_NOT_OK: transmission failed.
Functional Description
Triggers transmission of a memory access data message (DM16 or DM18).
When transmission is finished, the function configured as J1939DcmMemDataTxConfFunc is called.

© 2024 Vector Informatik GmbH Version 17.0.1 40


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> Service ID = 0x51
> This function is not reentrant
> This function is asynchronous
> This function is only available if at least one DM16 or DM18 message is configured
Call context
> This function can be called from any context
Table 4-15 J1939Dcm_MemDataTransmit()

4.2.10 J1939Dcm_ProvideTestResultOfDm8()
Prototype
Std_ReturnType J1939Dcm_ProvideTestResultOfDm8 (
J1939Dcm_AddressInfoType* addressInfo,
PduInfoType* pduInfo )

Parameter
addressInfo1 Source / Destination Address and Channel of the message to be sent.
pduInfo Pointer to the buffer (SduDataPtr) and its length (SduLength) containing
the data to be transmitted by the lower layer module.
Return code
Std_ReturnType > E_OK: Message transmission started.
> J1939DCM_E_BUSY: Transmission currently not possible. Try again in the
next task cycle.
> E_NOT_OK: Node / Channel combination for DM8 is not in state online, or
transmission buffer cannot hold the requested number of bytes, or the
number of bytes to be transmitted is 0.
Functional Description
Starts the transmission of the DM8 message.
Particularities and Limitations
> This function is synchronous
Call context
> This function can be called from any context
Table 4-16 J1939Dcm_ProvideTestResultOfDm8()

4.2.11 J1939Dcm_ProvideTestResultOfDm30()
Prototype
Std_ReturnType J1939Dcm_ProvideTestResultOfDm30 (
J1939Dcm_AddressInfoType* addressInfo,
PduInfoType* pduInfo )

1 SourceAddress contains the address of the node, the DestinationAddress contains the address of the
tester. For details how to setup Source- and DestinationAddress see 4.5.2.1 J1939Dcm_ExecuteTest().

© 2024 Vector Informatik GmbH Version 17.0.1 41


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Parameter
addressInfo2 Source / Destination Address and Channel of the message to be sent.
pduInfo Pointer to the buffer (SduDataPtr) and its length (SduLength) containing
the data to be transmitted by the lower layer module.
Return code
Std_ReturnType > E_OK: Message transmission started.
> J1939DCM_E_BUSY: Transmission currently not possible. Try again in the
next task cycle.
> E_NOT_OK: Node / Channel combination for DM30 is not in state online, or
transmission buffer cannot hold the requested number of bytes, or the
number of bytes to be transmitted is 0.
Functional Description
Starts the transmission of the DM30 message.
Particularities and Limitations
> This function is synchronous
Call context
> This function can be called from any context
Table 4-17 J1939Dcm_ProvideTestResultOfDm30()

4.2.12 J1939Dcm_ProvideTestResultOfDm58()
Prototype
Std_ReturnType J1939Dcm_ProvideTestResultOfDm58 (
J1939Dcm_AddressInfoType* addressInfo,
PduInfoType* pduInfo )
Parameter
addressInfo3 Source / Destination Address and Channel of the message to be sent.
pduInfo Pointer to the buffer (SduDataPtr) and its length (SduLength) containing
the data to be transmitted by the lower layer module.
Return code
Std_ReturnType > E_OK: Message transmission started.
> J1939DCM_E_BUSY: Transmission currently not possible. Try again in the
next task cycle.
> E_NOT_OK: Node / Channel combination for DM58 is not in state online, or
transmission buffer cannot hold the requested number of bytes, or the
number of bytes to be transmitted is 0.
Functional Description
Starts the transmission of the DM58 message.

2 SourceAddress contains the address of the node, the DestinationAddress contains the address of the
tester. For details how to setup Source- and DestinationAddress see 4.5.2.1 J1939Dcm_ExecuteTest().
3 SourceAddress contains the address of the node, the DestinationAddress contains the address of the

tester. For details how to setup Source- and DestinationAddress see 4.5.2.1 J1939Dcm_ExecuteTest().

© 2024 Vector Informatik GmbH Version 17.0.1 42


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> This function is synchronous
Call context
> This function can be called from any context
Table 4-18 J1939Dcm_ProvideTestResultOfDm58()

© 2024 Vector Informatik GmbH Version 17.0.1 43


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4.3 Services used by J1939DCM


The following table lists services provided by other components, which are used by the
J1939DCM. For details about prototype and functionality refer to the documentation of the
providing component.
Component API
PduR PduR_J1939DcmTransmit
J1939Rm J1939Rm_SendAck
Det Det_ReportError
BswM BswM_J1939DcmBroadcastStatus
Dem Dem_J1939DcmClearDTC
Dem_J1939DcmClearSingleDTC
Dem_J1939DcmFirstDTCwithLampStatus
Dem_J1939DcmGetNextDTCwithLampStatus
Dem_J1939DcmGetNextFilteredDTC
Dem_J1939DcmGetNextFreezeFrame
Dem_J1939DcmGetNextFilteredRatio
Dem_J1939DcmGetNextSPNInFreezeFrame
Dem_J1939DcmGetNumberOfFilteredDTC
Dem_J1939DcmSetDTCFilter
Dem_J1939DcmSetFreezeFrameFilter
Dem_J1939DcmSetRatioFilter
Dem_J1939DcmReadDiagnosticReadiness1
Dem_J1939DcmReadDiagnosticReadiness2
Dem_J1939DcmReadDiagnosticReadiness3
Table 4-19 Services used by the J1939DCM

© 2024 Vector Informatik GmbH Version 17.0.1 44


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4.4 Callback Functions


This chapter describes the callback functions that are implemented by the J1939DCM and
can be invoked by other modules. The prototypes of the callback functions are provided in
the header file J1939Dcm_Cbk.h by the J1939DCM.
4.4.1 J1939Dcm_CopyRxData()
Prototype
BufReq_ReturnType J1939Dcm_CopyRxData ( PduIdType id,
PduInfoType* info,
PduLengthType* bufferSizePtr )
Parameter
id Identification of the received I-PDU.
info Pointer to the buffer (SduDataPtr) and its length (SduLength) containing the
data to be copied by the upper layer module.
bufferSizePtr Available receive buffer after data has been copied.
Return code
BufReq_ReturnType > BUFREQ_OK: Data copied successfully.
> BUFREQ_E_NOT_OK: Data was not copied because an error occurred.
Functional Description
This function is called to provide the received data of an I-PDU segment (N-PDU) to the upper layer.
Each call to this function provides the next part of the I-PDU data.
The size of the remaining data is written to the position indicated by bufferSizePtr.
Particularities and Limitations
> Service ID = 0x44
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-20 J1939Dcm_CopyRxData()

4.4.2 J1939Dcm_CopyTxData()
Prototype
BufReq_ReturnType J1939Dcm_CopyTxData ( PduIdType id,
PduInfoType* info,
RetryInfoType* retry,
PduLengthType* availableDataPtr )

Parameter
id Identification of the transmitted I-PDU.
info Provides the destination buffer and the number of bytes to be copied.
If not enough transmit data is available, no data is copied. The transport
protocol module may retry.
A copy size of 0 can be used to indicate state changes in the retry parameter.

© 2024 Vector Informatik GmbH Version 17.0.1 45


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

retry This parameter is used to acknowledge transmitted data or to retransmit data


after transmission problems.
If the retry parameter is a NULL_PTR, it indicates that the transmit data can be
removed from the buffer immediately after it has been copied. Otherwise, the
retry parameter must point to a valid RetryInfoType element.
If TpDataState indicates TP_CONFPENDING, the previously copied data must
remain in the TP buffer to be available for error recovery.
TP_DATACONF indicates that all data that has been copied before this call is
confirmed and can be removed from the TP buffer. Data copied by this API call
is excluded and will be confirmed later.
TP_DATARETRY indicates that this API call shall copy previously copied data
in order to recover from an error. In this case TxTpDataCnt specifies the offset
in bytes from the current data copy position.
availableDataPtr Indicates the remaining number of bytes that are available in the upper layer
module's Tx buffer. availableDataPtr can be used by TP modules that support
dynamic payload lengths (e.g. FrIsoTp) to determine the size of the following
CFs.
Return code
BufReq_ReturnType > BUFREQ_OK: Data has been copied to the transmit buffer completely as
requested.
> BUFREQ_E_BUSY: Request could not be fulfilled, because the required
amount of Tx data is not available. The LoTp module can either retry the
request with the same PduInfoPtr or treat the return value like
BUFREQ_E_NOT_OK.
> BUFREQ_E_NOT_OK: Data has not been copied. Request failed.
Functional Description
This function is called to acquire the transmit data of an I-PDU segment (N-PDU).
Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is
TP_DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current
position indicated by retry->TxTpDataCnt.
The size of the remaining data is written to the position indicated by availableDataPtr.
Particularities and Limitations
> Service ID = 0x43
> This function is not reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-21 J1939Dcm_CopyTxData()

4.4.3 J1939Dcm_StartOfReception()
Prototype
BufReq_ReturnType J1939Dcm_StartOfReception ( PduIdType id,
PduInfoType* info,
PduLengthType TpSduLength,
PduLengthType* bufferSizePtr )

© 2024 Vector Informatik GmbH Version 17.0.1 46


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Parameter
id Identification of the I-PDU.
info Pointer to a PduInfoType structure containing the payload data (without
protocol information) and payload length of the first frame or single frame of a
transport protocol I-PDU reception. Depending on the global parameter
MetaDataLength, additional bytes containing MetaData (e.g. CAN ID) are
appended after the payload data.
TpSduLength Total length of the N-SDU to be received.
bufferSizePtr Available receive buffer in the receiving module. This parameter will be used to
compute the Block Size (BS) in the transport protocol module.
Return code
BufReq_ReturnType > BUFREQ_OK: Connection has been accepted, bufferSizePtr indicates the
available receive buffer; reception is continued.
> BUFREQ_E_NOT_OK: Connection has been rejected; reception is aborted,
bufferSizePtr remains unchanged.
> BUFREQ_E_OVFL: No buffer of the required length can be provided,
reception is aborted. bufferSizePtr remains unchanged.
Functional Description
This function is called at the start of receiving an N-SDU.
The N-SDU might be fragmented into multiple N-PDUs (FF with one or more following CFs) or might
consist of a single N-PDU (SF).
Particularities and Limitations
> Service ID = 0x46
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-22 J1939Dcm_StartOfReception()

4.4.4 J1939Dcm_RxIndication()
Prototype
void J1939Dcm_RxIndication ( PduIdType id,
const PduInfoType* PduInfoPtr )

Parameter
id Identification of the received I-PDU.
PduInfoPtr Contains the length (SduLength) of the received I-PDU and a pointer to
a buffer (SduDataPtr) containing the I-PDU.
Return code
void N/A
Functional Description
Called after an I-PDU has been received via the IF API, the result indicates whether the reception was
successful or not.

© 2024 Vector Informatik GmbH Version 17.0.1 47


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> Service ID = 0x42
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-23 J1939Dcm_RxIndication()

4.4.5 J1939Dcm_TpRxIndication()
Prototype
void J1939Dcm_TpRxIndication ( PduIdType id, Std_ReturnType result )
Parameter
id Identification of the received I-PDU.
result Result of the reception.
Return code
void N/A
Functional Description
Called after an I-PDU has been received via the TP API, the result indicates whether the reception was
successful or not.
Particularities and Limitations
> Service ID = 0x45
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-24 J1939Dcm_TpRxIndication()

4.4.6 J1939Dcm_TpTxConfirmation()
Prototype
void J1939Dcm_TpTxConfirmation ( PduIdType id, Std_ReturnType result )

Parameter
id Identification of the transmitted I-PDU.
result Result of the transmission.
Return code
void N/A
Functional Description
This function is called after the I-PDU has been transmitted via the TP API, the result indicates whether the
transmission was successful or not.

© 2024 Vector Informatik GmbH Version 17.0.1 48


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> Service ID = 0x48
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-25 J1939Dcm_TpTxConfirmation()

4.4.7 J1939Dcm_TxConfirmation()
Prototype
void J1939Dcm_TxConfirmation ( PduIdType id )
Parameter
id Identification of the transmitted I-PDU.
Return code
void N/A
Functional Description
This function is called after the I-PDU has been transmitted via the IF API to indicate that the transmission
has been completed.
Particularities and Limitations
> Service ID = 0x40
> This function is reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-26 J1939Dcm_TxConfirmation()

4.4.8 J1939Dcm_DemTriggerOnDTCStatus ()
Prototype
void J1939Dcm_DemTriggerOnDTCStatus ( uint32 DTC, uint8 ClientId )

Parameter
DTC Diagnostic Trouble Code in UDS format.
ClientId Dem client Id of a specific node.
Return code
void N/A.
Functional Description
Indicates changes of an UDS DTC status byte. This function is called by the DEM and triggers transmission
of a non periodic DM1 message.

© 2024 Vector Informatik GmbH Version 17.0.1 49


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> Service ID = 0x0A
> This function is not reentrant
> This function is synchronous
Call context
> This function can be called from any context
Table 4-27 J1939Dcm_DemTriggerOnDTCStatus ()

4.5 Configurable Interfaces


4.5.1 Memory Access Callout Functions
At its configurable interfaces, the J1939DCM defines callout functions to handle the J1939
memory access message (see 3.3).
The mapping is not statically defined by the J1939DCM but can be performed at
configuration time. The function prototypes that can be used for the configuration have to
match the appropriate function prototype signatures which are described in the following
sub-chapters.
A header file containing the function prototypes have to be specified through the
configuration parameter J1939DcmMemAccessHeaderFile.
To get the type definitions needed to implement the APIs, J1939Dcm_Types.h must be
included.
4.5.1.1 J1939DcmMemRequestIndicationFunc
Prototype
void [J1939DcmMemRequestIndicationFunc] (
J1939Dcm_AddressInfoType* AddressInfo,
J1939Dcm_MemReqParamType* MemRequestInfo )
Parameter
AddressInfo Source / Destination Address and Channel of the received message.
MemRequestInfo Parameters of the received DM14 message.
Return code
void N/A
Functional Description
Informs the application about the reception of a Memory Access Request message (DM14).
Particularities and Limitations
> This function must be reentrant
> At least one DM14 message must be configured
Call context
> This function can be called from any context
Table 4-28 J1939DcmMemRequestIndicationFunc

© 2024 Vector Informatik GmbH Version 17.0.1 50


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4.5.1.2 J1939DcmMemResponseTxConfFunc
Prototype
void [J1939DcmMemResponseTxConfFunc] ( Std_ReturnType Result )
Parameter
Result > E_OK: DM15 has been transmitted.
> E_NOT_OK: DM15 transmission failed.
Return code
void N/A
Functional Description
Informs the application that a transmission started with J1939Dcm_MemResponseTransmit() is
complete.
Particularities and Limitations
> This function must be reentrant
> At least one DM15 message must be configured
Call context
> This function can be called from any context
Table 4-29 J1939DcmMemResponseTxConfFunc

4.5.1.3 J1939DcmMemDataStartOfReceptionFunc
Prototype
BufReq_ReturnType [J1939DcmMemDataStartOfReceptionFunc] (
J1939Dcm_MemDataType DataKind,
J1939Dcm_AddressInfoType* AddressInfo,
PduLengthType TpSduLength,
PduLengthType* BufferSizePtr )
Parameter
DataKind Kind of data which is received; it can be:
> J1939DCM_MEM_DATA_BINARY
> J1939DCM_MEM_DATA_SECURITY
AddressInfo Source / Destination Address and Channel of the received message.
TpSduLength Overall length of message which is received.
BufferSizePtr Size of available receive buffer in the receiving module.
Return code
BufReq_ReturnType > BUFREQ_OK: Connection has been accepted, bufferSizePtr indicates the
available receive buffer; reception is continued.
> BUFREQ_E_NOT_OK: Connection has been rejected, reception is aborted.
> BUFREQ_E_OVFL: No buffer of the required length can be provided,
reception is aborted.
Functional Description
Informs the application that reception of a memory access data message has started.

© 2024 Vector Informatik GmbH Version 17.0.1 51


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> This function must be reentrant
> At least one DM16 or DM18 message must be configured
Call context
> This function can be called from any context
Table 4-30 J1939DcmMemDataStartOfReceptionFunc

4.5.1.4 J1939DcmMemDataCopyRxFunc
Prototype
BufReq_ReturnType [J1939DcmMemDataCopyRxFunc] (
J1939Dcm_MemDataType DataKind,
J1939Dcm_AddressInfoType* AddressInfo,
const PduInfoType* PduInfo,
PduLengthType* BufferSizePtr )
Parameter
DataKind Kind of data which is received; it can be:
> J1939DCM_MEM_DATA_BINARY
> J1939DCM_MEM_DATA_SECURITY
AddressInfo Source / Destination Address and Channel of the received message.
PduInfo Pointer to the buffer (SduDataPtr) and its length (SduLength) containing the
data to be copied by the upper layer module.
BufferSizePtr Available receive buffer after data has been copied.
Return code
BufReq_ReturnType > BUFREQ_OK: Data copied successfully.
> BUFREQ_E_NOT_OK: Data was not copied because an error occurred.
Functional Description
Request the application to copy data of a received memory access data message.
Particularities and Limitations
> This function must be reentrant
> At least one DM16 or DM18 message must be configured
Call context
> This function can be called from any context
Table 4-31 J1939DcmMemDataCopyRxFunc

4.5.1.5 J1939DcmMemDataRxIndicationFunc
Prototype
void [J1939DcmMemDataRxIndicationFunc] (
J1939Dcm_MemDataType DataKind,
J1939Dcm_AddressInfoType* AddressInfo,
const PduInfoType* PduInfo,
Std_ReturnType Result )

© 2024 Vector Informatik GmbH Version 17.0.1 52


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Parameter
DataKind Kind of data which is received; it can be:
> J1939DCM_MEM_DATA_BINARY
> J1939DCM_MEM_DATA_BOOTLOAD
> J1939DCM_MEM_DATA_SECURITY
AddressInfo Source / Destination Address and Channel of the received message.
PduInfo Pointer to the buffer (SduDataPtr) and its length (SduLength) containing the
data received data.
Note: this parameter is only valid when DataKind is
J1939DCM_MEM_DATA_BOOTLOAD
Result > E_OK: data message has been received successfully.
> E_NOT_OK: receive error after StartOfReception has been indicated.
Return code
void N/A
Functional Description
Notify the application that the reception of a memory access data message is complete.
Particularities and Limitations
> This function must be reentrant
> At least one DM16, DM17 or DM18 message must be configured
Call context
> This function can be called from any context
Table 4-32 J1939DcmMemDataRxIndicationFunc

4.5.1.6 J1939DcmMemDataTxConfFunc
Prototype
void [J1939DcmMemDataTxConfFunc] ( J1939Dcm_MemDataType DataKind,
Std_ReturnType Result )
Parameter
DataKind Kind of data which has been transmitted; it can be:
> J1939DCM_MEM_DATA_BINARY
> J1939DCM_MEM_DATA_SECURITY
Result > E_OK: data message has been transmitted.
> E_NOT_OK: data message transmission failed.
Return code
void N/A
Functional Description
Informs the application that a transmission started with J1939Dcm_MemDataTransmit() is complete.

© 2024 Vector Informatik GmbH Version 17.0.1 53


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Particularities and Limitations


> This function must be reentrant
> At least one DM16 or DM18 message must be configured
Call context
> This function can be called from any context
Table 4-33 J1939DcmMemDataTxConfFunc

4.5.2 Application Callout Functions


The J1939DCM defines callout functions to handle the J1939 access to the application
(see 3.4). The mapping is statically defined by the J1939DCM. The function prototype
which has to be used is described in the following sub-chapter. To get the type definitions
and the definition of the prototype to implement the call-out within the application,
J1939Dcm.h must be included.
4.5.2.1 J1939Dcm_ExecuteTest()
Prototype
Std_ReturnType J1939Dcm_ExecuteTest ( uint8 tid,
uint32 spn,
uint8 fmi,
J1939Dcm_AddressInfoType* addressInfo )
Parameter
tid Test Identifier.
spn Suspect Parameter Number.
fmi Failure Mode Indicator.
addressInfo4 Source / Destination Address and Channel of the received message.
Return code
Std_ReturnType > E_OK: TID, SPN and FMI are supported.
> E_NOT_OK: TID, SPN or FMI are not supported.
Functional Description
Command manufacturer specific tests, Command standard tests (if applicable) or Command to return last
measured scaled results
Particularities and Limitations
> This function is synchronous
> DM7 must be configured
Call context
> This function is called from task context
Table 4-34 J1939Dcm_ExecuteTest()

4 See further information in the info box.

© 2024 Vector Informatik GmbH Version 17.0.1 54


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Note
SourceAddress contains the address of the tester.
DestinationAddress contains the address of the node.
Therefore, it is required to use the SourceAddress from the parameter addressInfo and
use it as DestinationAddress when one of API functions
J1939Dcm_ProvideTestResultOfDm8() or J1939Dcm_ProvideTestResultOfDm58() is
used to send the response to tester. The same is applicable for the DestinationAddress
(see example below).
Example:
Std_ReturnType J1939Dcm_ExecuteTest(
uint8 tid,
uint32 spn,
uint8 fmi,
P2CONST(J1939Dcm_AddressInfoType, AUTOMATIC, J1939DCM_APPL_DATA) addressInfo)
{
J1939Dcm_AddressInfoType lResponseAddressInfo;
PduInfoType lResponseData;

/* Setup response data */


lResponseData.SduLength = 8;
lResponseData.SduDataPtr = ...;

/* Setup the addressInfo for the response */


lResponseAddressInfo.Channel = addressInfo->Channel;
lResponseAddressInfo.SourceAddress = addressInfo->DestinationAddress;
lResponseAddressInfo.DestinationAddress = addressInfo->SourceAddress;

/* Trigger the response */


J1939Dcm_ProvideTestResultOfDm58(&lResponseAddressInfo, &lResponseData);

return E_OK;
}

4.5.2.2 J1939Dcm_GetCalibrationVerificationNumber()
Prototype
Std_ReturnType J1939Dcm_GetCalibrationVerificationNumber (
uint8 nodeAddress,
uint32* calibrationVerificationNumber,
J1939Dcm_CalibrationIDArrayType calibrationID )
Parameter
nodeAddress5 Address of the node from which the calibration information has to be read.
calibrationVerifi- Pointer to which the application can write the calibration verification number.
cationNumber
calibrationID6 Pointer to which the application can write the calibration ID. The size of the
calibration ID is limited to 16 bytes. The application must not write more than
16 bytes to this pointer.

5 Deviation from [1]


6 J1939Dcm_CalibrationIDArrayType is defined in chapter 8.7.2 in [1]

© 2024 Vector Informatik GmbH Version 17.0.1 55


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Return code
- > E_OK: Calibration Verification Number available. No more Calibration
Verification Numbers available.
> J1939DCM_E_NOT_READY: Calibration Verification Number not calculated.
Retry again later.
> J1939DCM_E_NEXT: Calibration Verification Number available. More
Calibration Verification Numbers available.
Functional Description
Reads a pair of Calibration Verification Number (CVN) and Calibration Identification (CAL ID) for the
specified node.
Particularities and Limitations
> This function is asynchronous
Call context
> This function is called from task context
> DM19 must be configured
Table 4-35 J1939Dcm_GetCalibrationVerificationNumber()

4.5.2.3 J1939Dcm_GetDeviceActiveTime()
Prototype
Std_ReturnType J1939Dcm_GetDeviceActiveTime ( uint8 nodeAddress,
uint8* eiaecdNumber,
uint32* eiaecdTimer1,
uint32* eiaecdTimer2 )
Parameter
nodeAddress Address of the node from which the device active time has to be read.
eiaecdNumber Pointer to address where the EI-AECD Number will be stored.
eiaecdTimer1 Pointer to address where the engine runtime 1 will be stored.
eiaecdTimer2 Pointer to address where the engine runtime 2 will be stored.
Return code
Std_ReturnType > E_OK: EI-AECD Number available. No more EI-AECD Numbers available.
> J1939DCM_E_NEXT: EI-AECD Number available. More EI-AECD Numbers
available.
Functional Description
Reads the engine runtimes for the DM33.
Particularities and Limitations
> This function is asynchronous
> If the application does not utilize EI-AECDs, the application has to return E_OK for the first call of this
function and has to set the values:
- eiaecdNumber to FB16
- eiaecdTimer1 to 0
- eiaecdTimer2 to 0
> DM33 must be configured

© 2024 Vector Informatik GmbH Version 17.0.1 56


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Call context
> This function is called from task context
Table 4-36 J1939Dcm_GetDeviceActiveTime()

4.5.2.4 J1939Dcm_GetModelYear()
Prototype
Std_ReturnType J1939Dcm_GetModelYear (
uint8 nodeAddress,
J1939Dcm_ModelYearType modelYear,
J1939Dcm_CertificationEngineFamilyNameType certificationEngineFamilyName,
uint16* bufferLength )
Parameter
nodeAddress Address of the node from which the Model Year and Certification
Engine Family has to be read.
modelYear Pointer to address where the Model Year will be stored.
certificationEngineFamilyName Pointer to address where the Vehicle and Regulated Family Name
will be stored.
bufferLength In: Size of the buffer available for Vehicle and Regulated Family
Name. The application must not write more bytes to the
provided pointer certificationEngineFamilyName.
Out: Number of bytes written by application for Vehicle and
Regulated Family Name.
Return code
Std_ReturnType > E_OK: Call successful. Model Year and Certification Engine
Family provided.
> E_NOT_OK: Function call not successful.
Functional Description
Gets the Model Year and Certification Engine Family for the DM56.
Particularities and Limitations
> This function is synchronous
> DM56 must be configured
Call context
> This function is called from task context
Table 4-37 J1939Dcm_GetModelYear()

4.5.2.5 J1939Dcm_GetNteStatus()
Prototype
Std_ReturnType J1939Dcm_GetNteStatus ( uint8 nodeAddress,
J1939Dcm_NteStatusType* nteStatus )
Parameter
nodeAddress Address of the node from which the NTE status has to be read.

© 2024 Vector Informatik GmbH Version 17.0.1 57


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

nteStatus Pointer to address where the NTE Status will be stored.


Return code
Std_ReturnType > E_OK: Call successful. NTE Status provided.
> E_NOT_OK: Function call not successful.
Functional Description
Gets the NTE status for the DM34.
Particularities and Limitations
> This function is synchronous
> The reserved bits 1.1 and 1.2 of NoxStatus must be set to 11 as described in [6].
> The reserved bits 2.1 and 2.2 of PmStatus must be set to 11 as described in [6].
> DM34 must be configured
Call context
> This function is called from task context
Table 4-38 J1939Dcm_GetNteStatus()

4.5.2.6 J1939Dcm_GetObdInformation()
Prototype
Std_ReturnType J1939Dcm_GetObdInformation (
uint8 nodeAddress,
J1939Dcm_EngineWarmupSequenceType* engineWarmupSequence )
Parameter
nodeAddress Address of the node from which the OBD Information has to be
read.
engineWarmupSequence Pointer to address where the OBD Information will be stored.
Return code
Std_ReturnType > E_OK: Call successful. OBD Information provided.
> E_NOT_OK: Function call not successful.
Functional Description
Gets the OBD Information for the DM57.
Particularities and Limitations
> This function is synchronous
> DM57 must be configured
Call context
> This function is called from task context
Table 4-39 J1939Dcm_GetObdInformation()

© 2024 Vector Informatik GmbH Version 17.0.1 58


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

4.5.2.7 J1939Dcm_GetSupportedTestIdentifiers()
Prototype
Std_ReturnType J1939Dcm_GetSupportedTestIdentifiers(
uint8 nodeAddress,
J1939Dcm_SupportedTestIdentifiersType* supportedTestIdentifiers )
Parameter
nodeAddress Address of the node from which the Supported Non-Continuously
Monitored Systems Test Identifiers has to be read.
supportedTestIdentifiers Pointer to address where the bit mask for the Supported Non-
Continuously Monitored Systems Test Identifiers will be stored.
The size of the bit mask for the Supported Non-Continuously
Monitored Systems Test Identifiers is limited to 8 bytes. The
application must not write more than 8 bytes to this pointer.
Return code
Std_ReturnType > E_OK: Call successful. Bit mask fort the Supported Non-
Continuously Monitored Systems Test Identifiers provided.
> E_NOT_OK: Function call not successful.
Functional Description
Gets the Supported Non-Continuously Monitored Systems Test Identifiers for the DM10.
Particularities and Limitations
> This function is synchronous
> DM10 must be configured
Call context
> This function is called from task context
Table 4-40 J1939Dcm_GetSupportedTestIdentifiers()

4.5.2.8 J1939Dcm_TestResultTxConfirmation()
Prototype
void J1939Dcm_TestResultTxConfirmation ( Std_ReturnType result )
Parameter
result > E_OK: Message has been transmitted.
> E_NOT_OK: Message transmission failed.
Return code
void N/A
Functional Description
Informs the application about the result of the transmission of DM8 / DM58 message.
Particularities and Limitations
> This function is synchronous
> At least one DM8 or DM58 message must be configured

© 2024 Vector Informatik GmbH Version 17.0.1 59


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Call context
> This function is called from task context
Table 4-41 J1939Dcm_TestResultTxConfirmation()

© 2024 Vector Informatik GmbH Version 17.0.1 60


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

5 Configuration

In the J1939DCM the attributes can be configured according to/with the following
methods/tools:
> DaVinci Configurator

5.1 Configuration Variants


The J1939DCM currently supports the configuration variants
> VARIANT-PRE-COMPILE
> VARIANT-POST-BUILD-SELECTABLE
> VARIANT-POST-BUILD-LOADABLE
> VARIANT-POST-BUILD-LOADABLE-SELECTABLE
The configuration classes of the J1939DCM parameters depend on the supported
configuration variants. For their definitions please see the J1939Dcm_bswmd.arxml file.

Caution
For configurations supporting VARIANT-POST-BUILD-LOADABLE or VARIANT-
POST-BUILD-LOADABLE-SELECTABLE, all supported DMs will be automatically
enabled, even if the DMs are not configured, allowing to add DMs later using the
POST-BUILD-LOADABLE feature. Not configured OBD II relevant DMs and the DM24
are excluded from this behavior by default.
If all supported OBD II relevant DMs shall be available for the POST-BUILD-
LOADABLE feature, this can be achieved by enabling the parameter:
/J1939Dcm/J1939DcmGeneral/J1939DcmEnableObdIIForPBL
If DM24 shall be available for the POST-BUILD-LOADABLE feature, this can be
achieved by enabling the parameter:
/J1939Dcm/J1939DcmGeneral/J1939DcmEnableDm24ForPBL

5.2 Configuration in Data Base


J1939DCM requires configuration of the diagnostic messages that shall be supported in
the input files of DaVinci Configurator. The simplest possibility to achieve that is to create a
DBC file.
The DBC file shall contain all diagnostic messages to be supported by the J1939DCM. For
each DM, a CAN message must be defined where the CAN ID Type is set to J1939 PG
(ext. ID), and where the CAN ID contains the PGN of the DM and the source address of
the sending node. For a complete list of PGNs, please refer to the SAE specification [6].
The DBC editor provides a dialog to define a J1939 CAN ID based on PGN and source
address.

© 2024 Vector Informatik GmbH Version 17.0.1 61


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

Figure 5-1 Definition of J1939 CAN identifiers in the DBC editor

5.3 Configurable Attributes


The description of each configurable option is described within the
J1939Dcm_bswmd.arxml file. You can use the online help of DaVinci Configurator 5 to
access these parameter descriptions comfortably.

© 2024 Vector Informatik GmbH Version 17.0.1 62


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

6 Using the J1939Dcm

This chapter shall give some examples and hints, how to handle common use cases of the
J1939Dcm.

6.1 How to handle DM13 Hold Signal 0001b


With the configuration parameter
/J1939Dcm/J1939DcmGeneral/J1939DcmDm13HoldSignalStateHasBeenModifiedSupport
ed
it is possible to specify which hold signal states of the DM13 message are handled by the
J1939Dcm. The following table shows which hold signal states are supported:
Parameter Value Supported hold signal states of DM13 message
False > 0000b (All Devices)
True > 0000b (All Devices)
> 0001b (Devices whose broadcast state has been modified)
Table 6-1 Supported hold signal states

6.2 How to handle Meta Data for reception of Diagnostic Messages


The Meta Data will be added behind the payload data by the CanIf or the J1939Tp
component. The length of the Meta Data in the J1939Dcm can be up to 4 bytes. The
following table shows which element is stored at the different positions within the Meta
Data:
Byte Position Stored Information
0 Source Address
1 Destination Address
2 PDU Format
3 Priority
Table 6-2 Meta Data content

The length of the Meta Data can be configured with the configuration parameter:
/EcuC/EcucPduCollection/Pdu/MetaDataLength
The Meta Data is relevant for the reception of the diagnostic messages DM7, DM13,
DM14, DM16, DM17 and DM18. Two configuration parameters are available to derive the
source address and the destination address in case that the Meta Data does not provide
this information.
If a Diagnostic message is received in standard CAN frame (11 bit), it is automatically
treated as broadcast message. To override this behavior the following parameter can be
used. This parameter can be automatically derived by a solving action from CanIf
component.

© 2024 Vector Informatik GmbH Version 17.0.1 63


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

/J1939Dcm/J1939DcmConfigSet/J1939DcmNode/J1939DcmDiagnosticMessageSupport/J
1939DcmRxPdu/J1939DcmRxPduBroadcast
The following parameter contains the source address which is used by the J1939Dcm in
case the Meta Data does not provide the source address (Meta Data length = 0). It can be
derived by a solving action from CanIf component.
/J1939Dcm/J1939DcmConfigSet/J1939DcmNode/J1939DcmDiagnosticMessageSupport/J
1939DcmRxPdu/J1939DcmRxPduSourceAddress
The following table shows how the J1939Dcm determines the Source Address (SA) and
the Destination Address (DA) for the different Meta Data Length cases:
Meta Data J1939Dcm Source Address Destination Address
Length RxPduBroadcast
0 False J1939DcmRxPduSourceAddress Own node Address
0 True J1939DcmRxPduSourceAddress Broadcast Address 0xFF
1 False SA from Meta Data Own node Address
1 True SA from Meta Data Broadcast Address 0xFF
>1 Don’t care SA from Meta Data DA from Meta Data
Table 6-3 Derivation of source and destination address

Note
The Meta Data Length 0 is only allowed for the Diagnostic Messages DM7, DM13,
DM14 and DM17.

6.3 How to handle global DM22 requests


Neither the SAE specification [6] nor AUTOSAR [1] specify the handling of a global DM22
request (destination address equal to broadcast address). Therefore, the DM22 request
clears the DTCs on the Nodes only if the receiving channel supports the DM22. The
following example shows on which Nodes the DTC is cleared when the request is received
on different Channels.
Node A Node B Node C
Channel 0 supported
Channel 1 supported supported supported
Channel 2 supported supported
Channel 3 supported
Table 6-4 Supported Node / Channel combinations for DM22

▪ If the request is received on Channel 0, the DTC will be cleared only on Node B.
▪ If the request is received on Channel 1, the DTC will be cleared on all Nodes.
▪ If the request is received on Channel 2, the DTC will be cleared on Node A and Node C.

© 2024 Vector Informatik GmbH Version 17.0.1 64


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

▪ If the request is received on Channel 3, the DTC will be cleared only on Node A.

6.4 How to mark a Node as OBD specific Node


For a destination specific DM11 request, it is necessary to distinguish whether the request
has to be handled for an OBD related product or for a non OBD related product. If a
destination specific DM11 request is received for an OBD related product a negative
acknowledgement has to be sent. The distinction whether a node is assigned to an OBD
related product or not can be done with the parameter:
/MICROSAR/J1939Dcm/J1939DcmConfigSet/J1939DcmNode/J1939DcmObdSpecific
The following table shows the response for DM11 requests in dependency of the
parameter J1939DcmObdSpecific:
J1939DcmObdSpecific Request type Response
false Destination Specific Positive acknowledgment in case all active
diagnostic trouble codes are cleared or no
active diagnostic trouble codes exists.
Negative acknowledgment in case the clearing
of diagnostic trouble codes failed for any
reason.
false Broadcast No response
true Destination Specific Negative acknowledgment
true Broadcast No response
Table 6-5 Responses for DM11 requests in dependency of the parameter J1939DcmObdSpecific

© 2024 Vector Informatik GmbH Version 17.0.1 65


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

7 Glossary and Abbreviations

7.1 Glossary

Term Description
DaVinci Configurator Configuration tool for MICROSAR Classic 4 components.
J1939 SAE Standard for vehicle communication, especially used in commercial
vehicles like trucks and tractors.
Table 7-1 Glossary

7.2 Abbreviations

Abbreviation Description
API Application Programming Interface
AUTOSAR Automotive Open System Architecture
BSW Basis Software
BSWMD Basis Software Module Description
CAN Controller Area Network
CDD Complex Device Driver
CF Consecutive Frame
DBC Data Base CAN
DCM Diagnostic Communication Manager
DEM Diagnostic Event Manager
DET Development Error Tracer
DM Diagnostic Message
DTC Diagnostic Trouble Code
ECU Electronic Control Unit
EDCP Error Detection and/or Correction Parameter
EI-AECD Emission Increasing Auxiliary Emission Control Device
FF First Frame (in the context of transport protocol communication)
Freeze Frame (in the context of failure storage)
ID Identifier
IF Interface
MICROSAR Microcontroller Open System Architecture (the Vector AUTOSAR solution)
NTE Not-To-Exceed
OBD On-board diagnostics
PDU Protocol Data Unit
PduR PDU-Router

© 2024 Vector Informatik GmbH Version 17.0.1 66


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

PG Parameter Group
PGN Parameter Group Number
PM Particulate Matter
RTE Runtime Environment
SAE Society of Automotive Engineers
SDU Service Data Unit
SF Single Frame
SPN Suspect Parameter Number
SRS Software Requirement Specification
SWC Software Component
SWS Software Specification
TP Transport Protocol
UDS Unified Diagnostic Services
Table 7-2 Abbreviations

© 2024 Vector Informatik GmbH Version 17.0.1 67


based on template version 5.7.1
Technical Reference MICROSAR Classic J1939 Diagnostic Communication Manager

8 Contact

Visit our website for more information on

> News
> Products
> Demo software
> Support
> Training data
> Addresses

www.vector.com

© 2024 Vector Informatik GmbH Version 17.0.1 68


based on template version 5.7.1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy