Search code examples
embeddedsimulinkautosar

DEM Fault detection counter vs aging counter


According to the Dem specification document ( AR 4.4.0 _ page 227 _ section 8.3.3.12)

Dem_GetFaultDetectionCounter Gets the fault detection counter of an event, but I can not find any clear explanation that How Fault detection works.

GetFaultDetectionCounter specification

My question is: What is Fault detection counter and its difference from aging counter?


Solution

  • The debouncing of DemEvents is specified in AUTOSAR Dem chapter 7.7.3 "Debouncing of diagnostic events".

    The fault detection counter is used for this debouncing. -128 means PASSED, +127 FAILED, 0 means, the monitor did not report anything (neither PASSED nor FAILED) yet. The sint8 range -128 .. 0 .. +127 is according to UDS spec ISO14229-1. The Dem can be configured with different thresholds with sint16, but they are linearly scaled down to sint8 for FDC when reading out.

    A monitor can report (using Dem_SetEventStatus(DemEventId, DemEventStatus):

    • DEM_EVENT_STATUS_FAILED - set FDC to thresholdMax
    • DEM_EVENT_STATUS_PREFAILED - increment FDC up to thresholdMax
    • DEM_EVENT_STATUS_PREPASSED - decrement FDC down to thresholdMin
    • DEM_EVENT_STATUS_PASSED - set FDC to thresholdMin

    Depending on the counter algorithm, counter or timer based deboucning is used.

    AUTOSAR Dem chapter 7.7.8 "Aging of diagnostic events" specifies the aging and the aging counter.

    The aging counter is actually, to be able to remove a DemEvent. If a DemEvent has been reported before, on each new operation cycle without a failed report, the aging counter is counted up to configured maximum. WHen it's reached, the DemEvent and its FreezeFrame/SnapshotData and ExtendedDataRecords can be removed.