ndUDSClearDiagnosticInformation
- Updated2025-10-07
- 2 minute(s) read
Purpose
Executes the UDS ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (DTCs).
Format
long ndUDSClearDiagnosticInformation(
TD1 *diagRef,
unsigned long groupOfDTC,
TD3 *DTCDescriptor,
LVBoolean *success);
Input
diagRef
Specifies the diagnostic session handle, obtained from ndOpenDiagnosticOnCANFD or ndOpenDiagnosticOnIPStack and passed to subsequent diagnostic functions. Normally, it is not necessary to manually manipulate the elements of this struct.
groupOfDTC
Specifies the group of diagnostic trouble codes to be cleared. The following value has a special meaning:
| 0xFFFFFF | All DTCs |
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 1.
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. Output
success
Indicates successful receipt of a positive response message for this diagnostic service.
Return Value
The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Use the ndStatusToString function to obtain a descriptive string for the return value.
DescriptionThis function clears the diagnostic information on the ECU memory. Depending on the value of groupOfDTC, the ECU is requested to clear the corresponding DTCs. The groupOfDTC values are application specific.
For further details about this service, refer to the ISO 15765-3 standard.