Chapter 6 Automotive Diagnostic Command Set API for C
© National Instruments Corporation 6-19 Automotive Diagnostic Command Set User Manual
ndDiagnosticService
Purpose
Executes a generic diagnostic service. If a special service is not available through the
KWP2000, UDS, or OBD service functions, you can build it using this function.
Format
long ndDiagnosticService(
TD1 *diagRef,
LVBoolean *requireResponse,
unsigned char dataIn[],
long len,
unsigned char dataOut[],
long *len2);
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.
requireResponse
Indicates whether a response to this service is required. If *requireResponse is
FALSE,
dataOut returns no values, and len2 returns 0. This parameter is passed by
reference.
dataIn
Contains the request message byte sequence for the diagnostic service sent to the ECU.
len
Must contain the number of valid data bytes in dataIn.
Output
dataOut
Contains the response message byte sequence of the diagnostic service returned from the
ECU.
len2
On input, len2 must contain the number of bytes provided for the dataOut buffer.
On output, it returns the number of valid data bytes in
dataOut.