= OBD Diagnostics (J1939 and Extended Diagnostics) = <> == Overview == OpenECU contains everything you need to make your ECU OBD compliant. * A [[Example Models#Extended_Diagnostics|demo model]] is provided by the platform as an example of using this blockset. This feature is supported on all OpenECU targets. ---- == Basic blockset features == The base platform has J1939 features that allow you to set, report, and clear DTCs; and report raw parameter groups based on data supplied by the user’s application logic. The blockset supports following a subset of the J1939 specification: * Handles requests for PGs by filtering out PGNs the model does not handle and returning NACK messages * Handles reception and transmission of J1939 messages * Handles the transport protocol (J1939/21) for sending long messages (up to 1785 bytes in length) * Handles some of the diagnostic requirements (J1939/73) for sending and receiving lists of diagnostic trouble codes (DM1 and DM2 messages). This includes support in the blockset for diagnostic trouble codes. * Handles the network protocol (J1939/81) as if the ECU and the rest of the network have fixed network nodes The table below highlights the features in the basic J1939 blockset: ||'''J1939 basic blockset feature list'''||'''Description'''|| ||J1939-73 DM1 receive||Receives and decodes the content of the lamp status.|| ||J1939 DM1 decode DTS||Decodes the contents of the last received J1939-73 DM1 message based on specified DTC data.|| ||J1939 DM2 receive||Indicated if a J1939-73 DM2 message has been received and decodes the contents of the lamp status.|| ||J1939 DM2 decode DTC||Decodes the contents of the last received J1939-73 DM2 message based on specified DTC data.|| ||J1939 DM2 transmit||Transmit a J1939-73 DM2 message containing the DTCs with a previously active state from a DTC table.|| ||J1939 inhibit reprogramming||Control whether reprogramming can occur via j1939 when the application is running.|| ||J1939 parameter group receive message||Extract the data contents from a received J1939 message.|| ||J1939 parameter group requested||Determine whether a Parameter Group (PG) has been requested by another J1939 network node.|| ||J1939 parameter group transmit||Construct the content of a J1939 message, and attempt to transmit it.|| For full details please refer to the OpenECU Users Guide. ---- == Extended diagnostic features == EXT_DIAG adds J1939 features to automatically report more complex messages such as Freeze Frame Data (DM4) and reflash of the ECU memory (DM16, etc). Some features require an additional license for the extended diagnostics blockset: * J1939 DM messages (except for DM1 and DM2, which are included in the standard blockset) * DTC management * PID management * UDS / KWP / J1979 support using ISO 15765 * Freeze-frame support * Diagnostic test and monitor entities * In-use performance ratios * And more The table below highlights the features of extended diagnostics blockset: ||'''J1939 extended diagnostics feature'''||'''Description'''|| ||Calibration verification number (CVN)||Calculates the calibration verification number of the code and calibration memory regions.|| ||DTC clear all||Set all DTCs referred to by the table identifier parameter, to the clear state, if the clear state is supported by the DTC.|| ||DTC clear all if active||Set all DTCs referred to by the table identifier parameter, to the clear state, if the clear state is supported by the DTC, and if the DTC state is currently active.|| ||DTC clear all if inactive||Set all DTCs referred to by the table identifier parameter, to the clear state, if the clear state is supported by the DTC, and if the DTC state is currently inactive.|| ||DTC match and clear||Clear all DTCs which match the DTC type, DTC emissions severity and DTC state, in accordance with the comparator parameters.|| ||DTC control||Start new drive, warm-up and ignition cycles. Handle engine running signal. Handle vehicle/ operating conditions for OBD clear of CARB permanent DTCs.|| ||DTC diagnostic trouble code||Define a diagnostic trouble code, and provide the platform with information relating to its fault conditions.|| ||DTC lamp states||Firstly, this indicates the required states of the Malfunction Indicator Lamp, the Red Stop Lamp, the Amber Warning Lamp and the Protection Lamp.|| ||DTC match exists||Determine the existence of DTCs which match the DTC type, DTC emissions severity and DTC state.|| ||DTC memory update||Retain the DTC tables in non-volatile storage across power cycles.|| ||DTC table definition||Declares a table of diagnostic trouble codes (DTCs), that can be referred to by other blocks that wish to refer to a group of DTCs.|| ||DTC table cleared indication||This block can be used to signal when a diagnostic command to clear all DTCs (or a subset of DTCs) has been received for the specified table.|| ||ISO configuration||Configure the ECU for ISO diagnostic communications.|| ||ISO security permissions||Configure whether sensitive services are available and related SecurityAccess settings.|| ||ISO DTC extended data records||UDS service $19 ExtendedDataRecord configuration.|| ||Routine control||Communicates UDS service 0x31 (routine control) IO to and from a diagnostic scan tool.|| ||Parameter identifier||Captures the current value of a parameter to internal memory or non-volatile memory for access by a diagnostic scan tool.|| ||Parameter identifier scaling||This block outputs a raw byte value to represent the input with the scaling applied.|| ||Freeze frame||Captures a list of specified parameters upon the occurrence of an active DTC. The captured parameter values are stored for access by a diagnostic scan tool.|| ||DM25 freeze frame||Specifies the list of SPN(s) to capture for a DM25 freeze frame.|| ||Freeze frame configuration||Specifies the amount of volatile (RAM) and non-volatile (flash) memory allocated for freeze frame storage.|| ||J1939 configuration||Configure the ECU for J1939 communications.|| ||J1939 DM1 receive||Indicates if a J1939/73 DM1 message has been received and decodes the contents of the lamp status.|| ||J1939 DM1 decode DTC||Decodes the contents of the last received J1939-73 DM1 message based on specified DTC data|| ||J1939 DM1 transmit||Transmit a J1939-73 DM1 message containing the DTCs with an active state from a DTC table.|| ||J1939 DM2 receive||Indicates if a J1939-73 DM2 message has been received and decodes the contents of the lamp status.|| ||J1939 DM2 decode DTC||Decodes the contents of the last received J1939-73 DM2 message based on specified DTC data.|| ||J1939 DM2 transmit||Transmit a J1939/73 DM2 message containing the DTCs with a previously active state from a DTC table.|| ||J1939 DM4 transmit||Transmit a J1939/73 DM4 message containing freeze frame data.|| ||J1939 DM5 transmit||Transmit a J1939/73 DM5 message containing the diagnostic readiness 1 data.|| ||J1939 DM6 transmit||Transmit a J1939/73 DM6 message containing the emissions-related DTCs with a pending state from a DTC table.|| ||J1939 DM7 decode||Decodes the contents of a received J1939/73 DM7 message.|| ||J1939 DM8 transmit||Transmit a J1939/73 DM8 message containing the test results for one of the non-continuously monitored tests invoked using DM7.|| ||J1939 DM10 transmit||Transmit a J1939/73 DM10 message containing the list of non-continuously monitored systems tests supported by the controller.|| ||J1939 DM12 transmit||Transmit a J1939/73 DM12 message containing the emissions-related DTCs with an active state from a DTC table.|| ||J1939 DM16 transmit||Transmit a J1939/73 DM16 message containing variable length data.|| ||J1939 DM20 transmit||Transmit a J1939/73 DM20 message containing the Performance Ratio Monitor data.|| ||J1939 DM21 transmit||Transmit a J1939/73 DM21 message containing the diagnostic readiness 2 data.|| ||J1939 DM23 transmit||Transmit a J1939/73 DM23 message containing the emissions-related DTCs with a previously active state from a DTC table.|| ||J1939 DM24 transmit||Transmit a J1939/73 DM24 message identifying supported SPNs.|| ||J1939 DM25 transmit||Request that a J1939 DM25 (expanded freeze frame) message is transmitted.|| ||J1939 DM26 transmit||Transmit a J1939/73 DM26 message containing the diagnostic readiness 3 data.|| ||J1939 DM27 transmit||Transmit a J1939/73 DM27 message containing the DTCs with a pending state from a DTC table.|| ||J1939 DM28 transmit||Transmit a J1939/73 DM28 message containing the active and permanent DTCs from a DTC table.|| ||J1939 DM29 transmit||Transmit a J1939/73 DM29 message which identifies the number of DTCs in each category on a per-table basis.|| ||J1939 DM30 transmit||Transmit a J1939/73 DM30 message containing the scaled test results for the applicable test(s) requested in a DM7 message. || ||J1939 DM31 transmit||Transmit a J1939/73 DM31 message containing the applicable lamp(s) for each DTC in a DTC table.|| ||J1939 DM32 transmit||Transmit a J1939/73 DM32 message containing the regulated exhaust emission level exceedance data.|| ||J1939 DM34 transmit||Transmit a J1939/73 DM34 message containing the NTE status data.|| ||J1939 DM35 transmit||Transmit a J1939/73 DM35 message containing the transient fault status of DTCs, from a DTC table.|| ||J1939 DM36 transmit||Transmit a J1939/73 DM36 message containing the vehicle harmonised roadworthiness data.|| ||J1939 DM37 transmit||Transmit a J1939/73 DM37 message containing the vehicle harmonised roadworthiness data.|| ||J1939 DM38 transmit||Transmit a J1939/73 DM38 message containing the Harmonised Global Technical Regulation (GTR) description.|| ||J1939 DM39 transmit||Transmit a J1939/73 DM39 message containing the system cumulative continuous MI data.|| ||J1939 DM40 transmit||Transmit a J1939/73 DM40 message containing the harmonised B1 failure counts.|| ||J1939 DM41 transmit||Transmit a J1939/73 DM41 message containing the pending emissions-class A DTCs from a DTC table.|| ||J1939 DM42 transmit||Transmit a J1939/73 DM42 message containing the confirmed and active emissions-class A DTCs from a DTC table.|| ||J1939 DM43 transmit||Transmit a J1939/73 DM43 message containing the previously active emissions-class A DTCs from a DTC table.|| ||J1939 DM44 transmit||Transmit a J1939/73 DM44 message containing the pending emissions-class B1 DTCs from a DTC table.|| ||J1939 DM45 transmit||Transmit a J1939/73 DM45 message containing the confirmed and active emissions-class B1 DTCs from a DTC table.|| ||J1939 DM46 transmit||Transmit a J1939/73 DM46 message containing the previously active emissions-class B1 DTCs from a DTC table.|| ||J1939 DM47 transmit||Transmit a J1939/73 DM47 message containing the pending emissions-class B2 DTCs from a DTC table.|| ||J1939 DM48 transmit||Transmit a J1939/73 DM48 message containing the confirmed and active emissions-class B2 DTCs from a DTC table.|| ||J1939 DM49 transmit||Transmit a J1939/73 DM49 message containing the previously active emissions-class B2 DTCs from a DTC table.|| ||J1939 DM50 transmit||Transmit a J1939/73 DM50 message containing the pending emissions-class C DTCs from a DTC table.|| ||J1939 DM51 transmit||Transmit a J1939/73 DM51 message containing the confirmed and active emissions-class C DTCs from a DTC table.|| ||J1939 DM52 transmit||Transmit a J1939/73 DM52 message containing the previously active emissions-class C DTCs from a DTC table.|| ||J1939 inhibit reprogramming||Control whether reprogramming can occur via J1939 when the application is running.|| ||J1939 parameter group receive message||Extract the data contents from a received J1939 message.|| ||J1939 parameter group requested||Determine whether a Parameter Group (PG) has been requested by another J1939 network node.|| ||J1939 parameter group transmit||Construct the contents of a J1939 message, and attempt to transmit it.|| ||J1939 send acknowledgement message||Attempt to send an acknowledgement in response to a J1939 request.|| ||J1939 update NTE status||Provide the facility to update the NTE status (as reported in J1939 message DM34).|| ||J1979 service $09 Infotype input||Declares vehicle specific information (VIN, calibration ID, etc) as per service $09 of the J1979 diagnostic protocol.|| ||Diagnostic monitor entity||Define a Diagnostic Monitor Entity.|| ||Diagnostic test entity||Define a Diagnostic Test Entity and the inputs which operate on it.|| ||General denominator||Provide the means to update the In-use performance ratio general denominator.|| ||Ignition cycle||Provide the means to update the In-use performance ratio ignition cycle counter.|| ||PPR memory update||Retain the In-use performance ratio data in non-volatile storage across power cycles.|| ||Monitors incomplete count||Provide a count of the total number of monitors (DMEs) that are enabled and have a readiness status of not complete.|| For full details please refer to the OpenECU User Guide. ---- == OBD source code for your ECU == Do you need to purchase an off-the-shelf OBD solution for your non-OpenECU ECU? See our [[http://pi-innovo.com/product/openecu-obd-infrastructure-software/|OBD Infrastructure Software]] page for more details.