Skip to main content

J1939GetNumOfDTCs

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

Description

Function looks through a J1939 diagnostic message and returns the number of DTC blocks that match the search criteria, i.e. that contains defined SPN/FMI/OC values.

Parameters

  • pgWithDTC: Message to be checked for a specific DTC block. Must be a J1939 Parameter Group.
  • spn: Suspect Parameter Number of the specified DTC. 0xFFFFFFFF if spn is to be ignored.
  • fmi: Failure Mode Identifier of the specified DTC. 0xFFFF if fmi is to be ignored.
  • oc: Occurrence Counter of the specified DTC. 0xFFFF if oc is to be ignored.

Return Values

  • ≥ 0: Byte number of the start position of the found DTC block (zero-based).
  • -1: Message does not contain a DTC block matching the search criteria.

Example