National Instruments 372139B-01 Automobile User Manual


 
Chapter 6 Automotive Diagnostic Command Set API for C
Automotive Diagnostic Command Set User Manual 6-26 ni.com
ndOpenDiagnostic
Purpose
Opens a diagnostic session on a CAN port. Communication to the ECU is not yet started.
Format
long ndOpenDiagnostic(
char CANInterface[],
unsigned long baudrate,
unsigned short transportProtocol,
unsigned long transmitID,
unsigned long receiveID,
TD1 *diagRefOut);
Input
CANInterface
Specifies the CAN interface on which the diagnostic communication should take place.
The values are CAN0, CAN1, and so on.
baudrate
The diagnostic communication baud rate.
transportProtocol
Specifies the transport protocol for transferring the diagnostic service messages over the
CAN network. The following values are valid:
0 ISO TP—Normal Mode. The ISO TP as specified in ISO 15765-2 is used;
all eight data bytes of the CAN messages are used for data transfer.
1 ISO TP—Mixed Mode. The ISO TP as specified in ISO 15765-2 is used;
the first data byte is used as address extension.
2 VW TP 2.0.
transmitID
The CAN identifier for sending diagnostic request messages from the host to the ECU.
receiveID
The CAN identifier for sending diagnostic response messages from the ECU to the host.