Chapter 6 Automotive Diagnostic Command Set API for C
Automotive Diagnostic Command Set User Manual 6-122 ni.com
ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle
Purpose
Executes the OBD Request Emission Related DTCs During Current Drive Cycle service.
Reads the emission-related Diagnostic Trouble Codes (DTCs) that occurred during the
current (or last completed) drive cycle.
Format
long ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle(
TD1 *diagRef,
TD3 *DTCDescriptor,
TD4 DTCs[],
long *len,
LVBoolean *success);
Input
diagRef
Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed
to subsequent diagnostic functions. Normally, it is not necessary to manually manipulate
the elements of this struct.
DTCDescriptor
A struct that describes the DTC records the ECU delivers:
typedef struct {
long DTCByteLength;
long StatusByteLength;
long AddDataByteLength;
unsigned short ByteOrder;
} TD3;
DTCByteLength
indicates the number of bytes the ECU sends for each DTC. The
default is 2.
StatusByteLength indicates the number of bytes the ECU sends for each DTC’s
status. The default is 0 for OBD.
AddDataByteLength indicates the number of bytes the ECU sends for each DTC’s
additional data. Usually, there are no additional data, so the default is 0.
ByteOrder indicates the byte ordering for multibyte items:
0: MSB_FIRST (Motorola), default
1: LSB_FIRST (Intel)
This function interprets the response byte stream according to this description and
returns the resulting DTC records in the
DTCs struct array.