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 VI. Format

Input

diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic on CAN FD.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
require response? indicates whether a diagnostic service expects a response (TRUE) or not (FALSE). In the latter case, error code is returned as 0, and data out as an empty array.
data in defines the diagnostic service request message sent to the ECU as a stream of bytes.
error in is a cluster that describes error conditions occurring before the VI executes. If an error has already occurred, the VI returns the value of the error in cluster to error out.
status is TRUE if an error occurred. This VI is not executed when status is TRUE.
code is the error code number identifying an error. A value of 0 means success. A negative value means error: the VI did not execute the intended operation. A positive value means warning: the VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
source identifies the VI where the error occurred.

Output

diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs.
error code is the error code sent with a negative response message. In addition, the error cluster indicates an error and gives a more detailed description. If no negative response message occurred, 0 is returned.
data out returns the diagnostic service response message (positive or negative) the ECU sends as a stream of bytes.
error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information. Otherwise, error out describes the error status of this VI.
status is TRUE if an error occurred.
code is the error code number identifying an error. A value of 0 means success. A negative value means error: the VI did not execute the intended operation. A positive value means warning: the VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
source identifies the VI where the error occurred.

Description

Diagnostic Service.vi is a generic routine to execute any diagnostic service. The request and response messages are fed unmodified to the data in input and retrieved from the data out output, respectively. No interpretation of the contents is done, with one exception: the error number is retrieved from a negative response, if one occurs. In this case, an error also is communicated through the error out cluster.

All specialized diagnostic services call Diagnostic Service.vi internally.