Nddtctostring, Nddtctostring -21 – National Instruments CAN 372139B-01 User Manual
Page 185

Chapter 6
Automotive Diagnostic Command Set API for C
© National Instruments Corporation
6-21
Automotive Diagnostic Command Set User Manual
ndDTCToString
Purpose
Returns a string representation (such as P1234) for a 2-byte diagnostic trouble code (DTC).
Format
void ndDTCToString(
unsigned long DTCNum,
char DTCString[],
long *len);
Input
DTCNum
The DTC number as returned in the DTCs structs of
ndUDSReportDTCBySeverityMaskRecord
,
ndUDSReportSeverityInformationOfDTC
,
ndOBDRequestEmissionRelatedDTCs
ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle
.
Note
This function converts only 2-byte DTCs. If you feed in larger numbers, the function
returns garbage.
Output
DTCString
The DTC string representation.
len
On input,
len
must contain the
DTCString
array length (at least 6). On return, it
contains the number of valid data bytes in the
DTCString
array.
Description
The SAE J2012 standard specifies a naming scheme for 2-byte DTCs consisting of one letter
and four digits. Use
ndDTCToString
to convert the DTC numerical representation to this
name.