Page 3 - Important Information; Warranty; Patents; WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. Nati...
Page 4 - Compliance; Determining FCC Class; Class A; Federal Communications Commission; Compliance with EU Directives
Compliance Compliance with FCC/Canada Radio Frequency Interference Regulations Determining FCC Class The Federal Communications Commission (FCC) has rules to protect wireless communications from interference. The FCC places digital electronics into two classes. These classes are known as Class A (fo...
Page 5 - Contents; About This Manual
© National Instruments Corporation v Automotive Diagnostic Command Set User Manual Contents About This Manual Conventions ................................................................................................................... xiRelated Documentation..........................................
Page 9 - Index
Contents © National Instruments Corporation ix Automotive Diagnostic Command Set User Manual ndTesterPresent ............................................................................................... 6-71ndWriteDataByLocalIdentifier .................................................................
Page 10 - Conventions; File»Page Setup»Options
© National Instruments Corporation xi Automotive Diagnostic Command Set User Manual About This Manual This manual provides instructions for using the Automotive Diagnostic Command Set. It contains information about installation, configuration, and troubleshooting, and also contains Automotive Diagno...
Page 11 - Related Documentation
About This Manual Automotive Diagnostic Command Set User Manual xii ni.com Related Documentation The following documents contain information that you might find helpful as you read this manual: • ANSI/ISO Standard 11898-1993, Road Vehicles—Interchange of Digital Information—Controller Area Network (...
Page 12 - Introduction
© National Instruments Corporation 1-1 Automotive Diagnostic Command Set User Manual 1 Introduction Diagnostics involve remote execution of routines, or services, on ECUs. To execute a routine, you send a byte string as a request to an ECU, and the ECU usually answers with a response byte string. Se...
Page 13 - Transport Protocol; Diagnostic Services; Diagnostic Service Format
Chapter 1 Introduction Automotive Diagnostic Command Set User Manual 1-2 ni.com Transport Protocol As KWP2000 uses messages of variable byte lengths, a transport protocol is necessary on layers with only a well defined (short) message length, such as CAN. The transport protocol splits a long KWP2000...
Page 15 - Measurements; Diagnostic Trouble Codes
Chapter 1 Introduction Automotive Diagnostic Command Set User Manual 1-4 ni.com Measurements Use the ReadDataByLocal/CommonIdentifier services to access ECU data in a way similar to a DAQ list. A Local/CommonIdentifier describes a list of ECU quantities that are then transferred from the ECU to the ...
Page 17 - External References
Chapter 1 Introduction Automotive Diagnostic Command Set User Manual 1-6 ni.com Note Some parameters to both the Request and Positive Response Messages are optional. Each service defines these parameters. Also, the standard does not define all parameters. The Negative Response Message is usually a t...
Page 18 - Installation and Configuration; Installation; Devices & Interfaces; Test Status
© National Instruments Corporation 2-1 Automotive Diagnostic Command Set User Manual 2 Installation and Configuration This chapter explains how to install and configure the Automotive Diagnostic Command Set. Installation This section discusses the Automotive Diagnostic Command Set installation for M...
Page 19 - Hardware and Software Requirements
Chapter 2 Installation and Configuration Automotive Diagnostic Command Set User Manual 2-2 ni.com Refer to Appendix A, Troubleshooting and Common Questions , of the NI-CAN User Manual for information about resolving hardware installation problems. When installation is complete, you can access the Au...
Page 20 - Application Development; Choosing the Programming Language; LabVIEW; Libraries»Automotive Diagnostic Command Set
© National Instruments Corporation 3-1 Automotive Diagnostic Command Set User Manual 3 Application Development This chapter explains how to develop an application using the Automotive Diagnostic Command Set API. Choosing the Programming Language The programming language you use for application devel...
Page 21 - Other Programming Languages
Chapter 3 Application Development Automotive Diagnostic Command Set User Manual 3-2 ni.com LabWindows/CVI examples. The examples are in the LabWindows/CVI \samples\Automotive Diagnostic Command Set directory. Each example includes a complete LabWindows/CVI project ( .prj file). The example descripti...
Page 22 - Debugging an Application; Diagnostic Monitor.vi
Chapter 3 Application Development © National Instruments Corporation 3-3 Automotive Diagnostic Command Set User Manual pointers to Automotive Diagnostic Command Set functions in the application. The following section describes how to use the Win32 functions for C/C++ environments other than Visual C...
Page 23 - Structure of the Automotive Diagnostic Command Set
© National Instruments Corporation 4-1 Automotive Diagnostic Command Set User Manual 4 Using the Automotive Diagnostic Command Set Structure of the Automotive Diagnostic Command Set Diagnostic Services Layer KWP2000 Services UDS (DiagOnCAN) Services OBD(OnBoardDiag) Services Auxiliary Routines Diagn...
Page 24 - Automotive Diagnostic Command Set API Structure
Chapter 4 Using the Automotive Diagnostic Command Set Automotive Diagnostic Command Set User Manual 4-2 ni.com The Automotive Diagnostic Command Set is structured into three layers of functionality: • The top layer implements three sets of diagnostic services for the diagnostic protocols KWP2000, UD...
Page 25 - General Programming Model
Chapter 4 Using the Automotive Diagnostic Command Set © National Instruments Corporation 4-3 Automotive Diagnostic Command Set User Manual General Programming Model First, you must open a diagnostic communication link. This involves initializing the CAN port and defining communication parameters suc...
Page 26 - Available Diagnostic Services
Chapter 4 Using the Automotive Diagnostic Command Set Automotive Diagnostic Command Set User Manual 4-4 ni.com When you finish your diagnostic services, you must close the diagnostic communication link. This finally closes the CAN port. For the VW TP 2.0, you should disconnect the communication chan...
Page 27 - Section Headings; Purpose; Format; Input and Output; Description
© National Instruments Corporation 5-1 Automotive Diagnostic Command Set User Manual 5 Automotive Diagnostic Command Set API for LabVIEW This chapter lists the LabVIEW VIs for the Automotive Diagnostic Command Set API and describes the format, purpose, and parameters for each VI. The VIs are listed ...
Page 28 - List of VIs; Function; Create Extended CAN IDs.vi; Diagnostic Service.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-2 ni.com List of VIs The following table is an alphabetical list of the Automotive Diagnostic Command Set VIs. Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW Function Purpose...
Page 29 - EnableNormalMessageTransmission.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-3 Automotive Diagnostic Command Set User Manual EnableNormalMessageTransmission.vi Executes the EnableNormalMessageTransmission service. The ECU starts transmitting its regular communication messages (us...
Page 33 - UDS WriteDataByIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-7 Automotive Diagnostic Command Set User Manual UDS WriteDataByIdentifier.vi Executes the UDS WriteDataByIdentifier service. Writes a data record to the ECU. UDS WriteMemoryByAddress.vi Executes the UDS ...
Page 34 - General Functions; Open
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-8 ni.com General Functions Close Diagnostic.vi Purpose Closes a diagnostic session. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired...
Page 35 - Output; StopDiagnosticSession.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-9 Automotive Diagnostic Command Set User Manual Output error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information. Otherwise, er...
Page 37 - data out; WriteDataByLocalIdentifier.vi; Convert
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-11 Automotive Diagnostic Command Set User Manual Output data out is the binary representation of the physical value. If you build a record of multiple values, you can concatenate the outputs of several i...
Page 39 - ReadDataByLocalIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-13 Automotive Diagnostic Command Set User Manual Description Data output from diagnostic services (for example, ReadDataByLocalIdentifier.vi ) is usually a byte stream of binary data. If you have a descr...
Page 41 - property ID
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-15 Automotive Diagnostic Command Set User Manual Diag Get Property.vi Purpose Gets a diagnostic global internal parameter. Format Input property ID defines the parameter whose value is to be retrieved. Y...
Page 42 - Fill CAN Frames; property value
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-16 ni.com 6 Wait Frames to Send (N_WAIT) is the number of WAIT frames the master sends every time before a CTS frame is sent. If this value is set to a negative number (for example, 0xFFFFFFFF...
Page 51 - StartDiagnosticSession.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-25 Automotive Diagnostic Command Set User Manual 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 s...
Page 53 - VWTP Connection Test.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-27 Automotive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . You can wire it to subsequent diagnostic VIs. error out describes error conditions. If the error in cluster...
Page 55 - code; Simple Error
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-29 Automotive Diagnostic Command Set User Manual 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 operatio...
Page 58 - ClearDiagnosticInformation.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-32 ni.com KWP2000 Services ClearDiagnosticInformation.vi Purpose Executes the ClearDiagnosticInformation service and clears selected Diagnostic Trouble Codes (DTCs). Format Input DTC descripto...
Page 64 - DisableNormalMessageTransmission.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-38 ni.com DisableNormalMessageTransmission.vi Purpose Executes the DisableNormalMessageTransmission service. The ECU no longer transmits its regular communication messages (usually CAN message...
Page 70 - InputOutputControlByLocalIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-44 ni.com InputOutputControlByLocalIdentifier.vi Purpose Executes the InputOutputControlByLocalIdentifier service. Modifies ECU I/O port behavior. Format Input data in defines application-spec...
Page 77 - ReadECUIdentification.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-51 Automotive Diagnostic Command Set User Manual ReadECUIdentification.vi Purpose Executes the ReadECUIdentification service. Returns ECU identification data. Format Input diag ref in specifies the diagn...
Page 79 - ReadMemoryByAddress.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-53 Automotive Diagnostic Command Set User Manual ReadMemoryByAddress.vi Purpose Executes the ReadMemoryByAddress service. Reads data from the ECU memory. Format Input diag ref in specifies the diagnostic...
Page 84 - RequestRoutineResultsByLocalIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-58 ni.com RequestRoutineResultsByLocalIdentifier.vi Purpose Executes the RequestRoutineResultsByLocalIdentifier service. Returns results from a routine on the ECU. Format Input diag ref in spe...
Page 92 - StartRoutineByLocalIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-66 ni.com StartRoutineByLocalIdentifier.vi Purpose Executes the StartRoutineByLocalIdentifier service. Executes a routine on the ECU. Format Input diag ref in specifies the diagnostic session ...
Page 93 - StopRoutineByLocalIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-67 Automotive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . You can wire it to subsequent diagnostic VIs. data out returns application-specific output parameters from ...
Page 102 - WriteMemoryByAddress.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-76 ni.com WriteMemoryByAddress.vi Purpose Executes the WriteMemoryByAddress service. Writes data to the ECU memory. Format Input data in defines the memory block to be written to the ECU. diag...
Page 104 - UDS ClearDiagnosticInformation.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-78 ni.com UDS (DiagOnCAN) Services UDS ClearDiagnosticInformation.vi Purpose Executes the UDS ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (DTCs). Format Input ...
Page 106 - group of DTC
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-80 ni.com Description This VI clears the diagnostic information on the ECU memory. If the group of DTC parameter is present, the ECU is requested to clear all memory including the DTCs. For fu...
Page 107 - UDS CommunicationControl.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-81 Automotive Diagnostic Command Set User Manual UDS CommunicationControl.vi Purpose Executes the UDS CommunicationControl service. Use this VI to switch transmission and/or reception of the normal commu...
Page 109 - UDS ControlDTCSetting.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-83 Automotive Diagnostic Command Set User Manual UDS ControlDTCSetting.vi Purpose Executes the UDS ControlDTCSetting service. Modifies Diagnostic Trouble Code (DTC) generation behavior. Format Input diag...
Page 111 - UDS DiagnosticSessionControl.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-85 Automotive Diagnostic Command Set User Manual UDS DiagnosticSessionControl.vi Purpose Executes the UDS DiagnosticSessionControl service. Sets up the ECU in a specific diagnostic mode. Format Input dia...
Page 115 - UDS InputOutputControlByIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-89 Automotive Diagnostic Command Set User Manual UDS InputOutputControlByIdentifier.vi Purpose Executes the UDS InputOutputControlByIdentifier service. Modifies ECU I/O port behavior. Format Input data i...
Page 117 - UDS ReadDataByIdentifier.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-91 Automotive Diagnostic Command Set User Manual UDS ReadDataByIdentifier.vi Purpose Executes the UDS ReadDataByIdentifier service. Reads a data record from the ECU. Format Input diag ref in specifies th...
Page 119 - UDS ReadMemoryByAddress.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-93 Automotive Diagnostic Command Set User Manual UDS ReadMemoryByAddress.vi Purpose Executes the UDS ReadMemoryByAddress service. Reads data from the ECU memory. Format Input diag ref in specifies the di...
Page 121 - UDS ReportDTCBySeverityMaskRecord.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-95 Automotive Diagnostic Command Set User Manual UDS ReportDTCBySeverityMaskRecord.vi Purpose Executes the ReportDTCBySeverityMaskRecord subfunction of the UDS ReadDiagnosticTroubleCodeInformation servic...
Page 124 - UDS ReportDTCByStatusMask.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-98 ni.com UDS ReportDTCByStatusMask.vi Purpose Executes the ReportDTCByStatusMask subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (...
Page 127 - UDS ReportSeverityInformationOfDTC.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-101 Automotive Diagnostic Command Set User Manual UDS ReportSeverityInformationOfDTC.vi Purpose Executes the ReportSeverityInformationOfDTC subfunction of the UDS ReadDiagnosticTroubleCodeInformation ser...
Page 130 - UDS ReportSupportedDTCs.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-104 ni.com UDS ReportSupportedDTCs.vi Purpose Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads all supported Diagnostic Trouble Codes...
Page 135 - UDS RoutineControl.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-109 Automotive Diagnostic Command Set User Manual UDS RoutineControl.vi Purpose Executes the UDS RoutineControl service. Executes a routine on the ECU. Format Input mode defines the service operation mod...
Page 143 - UDS WriteMemoryByAddress.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-117 Automotive Diagnostic Command Set User Manual UDS WriteMemoryByAddress.vi Purpose Executes the UDS WriteMemoryByAddress service. Writes data to the ECU memory. Format Input data in defines the memory...
Page 145 - OBD Clear Emission Related Diagnostic Information.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-119 Automotive Diagnostic Command Set User Manual OBD (On-Board Diagnostics) Services OBD Clear Emission Related Diagnostic Information.vi Purpose Executes the OBD Clear Emission Related Diagnostic Infor...
Page 147 - OBD Request Control Of On-Board Device.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-121 Automotive Diagnostic Command Set User Manual OBD Request Control Of On-Board Device.vi Purpose Executes the OBD Request Control Of On-Board Device service. Modifies ECU I/O port behavior. Format Inp...
Page 149 - OBD Request Current Powertrain Diagnostic Data.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-123 Automotive Diagnostic Command Set User Manual OBD Request Current Powertrain Diagnostic Data.vi Purpose Executes the OBD Request Current Powertrain Diagnostic Data service. Reads a data record from t...
Page 151 - OBD Request Emission Related DTCs.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-125 Automotive Diagnostic Command Set User Manual OBD Request Emission Related DTCs.vi Purpose Executes the OBD Request Emission Related DTCs service. Reads all emission-related Diagnostic Trouble Codes ...
Page 154 - OBD Request Emission Related DTCs During Current Drive Cycle.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-128 ni.com OBD Request Emission Related DTCs During Current Drive Cycle.vi Purpose Executes the OBD Request Emission Related DTCs During Current Drive Cycle service. Reads the emission-related...
Page 157 - OBD Request On-Board Monitoring Test Results.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-131 Automotive Diagnostic Command Set User Manual OBD Request On-Board Monitoring Test Results.vi Purpose Executes the OBD Request On-Board Monitoring Test Results service. Reads a test data record from ...
Page 159 - OBD Request Powertrain Freeze Frame Data.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-133 Automotive Diagnostic Command Set User Manual OBD Request Powertrain Freeze Frame Data.vi Purpose Executes the OBD Request Powertrain Freeze Frame Data service. Reads an ECU data record stored while ...
Page 161 - OBD Request Supported PIDs.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-135 Automotive Diagnostic Command Set User Manual OBD Request Supported PIDs.vi Purpose Executes the OBD Request Current Powertrain Diagnostic Data service to retrieve the valid PID values for this servi...
Page 163 - OBD Request Vehicle Information.vi
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW © National Instruments Corporation 5-137 Automotive Diagnostic Command Set User Manual OBD Request Vehicle Information.vi Purpose Executes the OBD Request Vehicle Information service. Reads a set of information data from the ECU. Format Inp...
Page 166 - List of Data Types; Data Type
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-2 ni.com List of Data Types The following data types are used with the Automotive Diagnostic Command Set API for C functions. Table 6-1. Data Types for the Automotive Diagnostic Command Set for C Da...
Page 167 - List of Functions
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-3 Automotive Diagnostic Command Set User Manual List of Functions The following table contains an alphabetical list of the Automotive Diagnostic Command Set API functions. Table 6-2. Functions for the Automoti...
Page 176 - ndCloseDiagnostic
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-12 ni.com General Functions ndCloseDiagnostic Purpose Closes a diagnostic session. Format long ndCloseDiagnostic( TD1 *diagRefIn); Input diagRefIn Specifies the diagnostic session handle, obtained f...
Page 177 - ndConvertFromPhys
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-13 Automotive Diagnostic Command Set User Manual ndConvertFromPhys Purpose Converts a physical data value into a binary representation using a type descriptor. Format void ndConvertFromPhys( TD2 *typeDescripto...
Page 179 - ndConvertToPhys
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-15 Automotive Diagnostic Command Set User Manual ndConvertToPhys Purpose Converts a binary representation of a value into its physical value using a type descriptor. Format void ndConvertToPhys( TD2 *typeDescr...
Page 181 - ndCreateExtendedCANIds; ISO TP—Normal Mode
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-17 Automotive Diagnostic Command Set User Manual ndCreateExtendedCANIds Purpose Creates diagnostic CAN identifiers according to ISO 15765-2. Format void ndCreateExtendedCANIds ( unsigned short addressingMode, ...
Page 183 - ndDiagnosticService
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...
Page 184 - Return Value
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-20 ni.com 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...
Page 185 - ndDTCToString
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 DTCN...
Page 186 - ndGetProperty; Input; Timeout Diag Command
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-22 ni.com ndGetProperty Purpose Gets a diagnostic global internal parameter. Format void ndGetProperty( unsigned short propertyID, unsigned long *propertyValue); Input propertyID Defines the paramet...
Page 188 - ndOBDOpen
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-24 ni.com ndOBDOpen Purpose Opens a diagnostic session on a CAN port for OBD-II. Format long ndOBDOpen ( char CANInterface[], unsigned long baudrate, unsigned long transmitID, unsigned long receiveI...
Page 190 - ISO TP—Mixed Mode
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, u...
Page 195 - Status Code Use; Status Code
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-31 Automotive Diagnostic Command Set User Manual Status Code Use The application code should check the status returned from every Automotive Diagnostic Command Set function. If an error is detected, close all ...
Page 196 - ndVWTPConnect
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-32 ni.com ndVWTPConnect Purpose Establishes a connection channel to an ECU using the VW TP 2.0. Format long ndVWTPConnect( TD1 *diagRef, unsigned long channelID, unsigned char applicationType); Inpu...
Page 199 - ndVWTPDisconnect
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-35 Automotive Diagnostic Command Set User Manual ndVWTPDisconnect Purpose Terminates a connection channel to an ECU using the VW TP 2.0. Format long ndVWTPDisconnect( TD1 *diagRef); Input diagRef Specifies the...
Page 200 - ndClearDiagnosticInformation
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-36 ni.com KWP2000 Services ndClearDiagnosticInformation Purpose Executes the ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (DTCs). Format long ndClearDiagnosticInforma...
Page 202 - ndControlDTCSetting
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-38 ni.com ndControlDTCSetting Purpose Executes the ControlDTCSetting service. Modifies the generation behavior of selected Diagnostic Trouble Codes (DTCs). Format long ndControlDTCSetting( TD1 *diag...
Page 204 - ndDisableNormalMessageTransmission
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-40 ni.com ndDisableNormalMessageTransmission Purpose Executes the DisableNormalMessageTransmission service. The ECU no longer transmits its regular communication messages (usually CAN messages). For...
Page 205 - ndECUReset
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-41 Automotive Diagnostic Command Set User Manual ndECUReset Purpose Executes the ECUReset service. Resets the ECU. Format long ndECUReset( TD1 *diagRef, unsigned char mode, LVBoolean *success); Input diagRef S...
Page 207 - ndEnableNormalMessageTransmission
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-43 Automotive Diagnostic Command Set User Manual ndEnableNormalMessageTransmission Purpose Executes the EnableNormalMessageTransmission service. The ECU starts transmitting its regular communication messages (...
Page 208 - ndInputOutputControlByLocalIdentifier
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-44 ni.com ndInputOutputControlByLocalIdentifier Purpose Executes the InputOutputControlByLocalIdentifier service. Modifies the ECU I/O port behavior. Format long ndInputOutputControlByLocalIdentifie...
Page 212 - ndReadDTCByStatus
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-48 ni.com ndReadDTCByStatus Purpose Executes the ReadDiagnosticTroubleCodesByStatus service. Reads selected Diagnostic Trouble Codes (DTCs). Format long ndReadDTCByStatus( TD1 *diagRef, unsigned cha...
Page 213 - Bit
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-49 Automotive Diagnostic Command Set User Manual DTCDescriptor A struct that describes the DTC records the ECU delivers: typedef struct { long DTCByteLength; long StatusByteLength; long AddDataByteLength; unsi...
Page 215 - ndReadECUIdentification
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-51 Automotive Diagnostic Command Set User Manual ndReadECUIdentification Purpose Executes the ReadECUIdentification service. Returns ECU identification data. Format long ndReadECUIdentification( TD1 *diagRef, ...
Page 217 - ndReadMemoryByAddress
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-53 Automotive Diagnostic Command Set User Manual ndReadMemoryByAddress Purpose Executes the ReadMemoryByAddress service. Reads data from the ECU memory. Format long ndReadMemoryByAddress( TD1 *diagRef, unsigne...
Page 219 - ndReadStatusOfDTC
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-55 Automotive Diagnostic Command Set User Manual ndReadStatusOfDTC Purpose Executes the ReadStatusOfDiagnosticTroubleCodes service. Reads selected Diagnostic Trouble Codes (DTCs). Format long ndReadStatusOfDTC...
Page 222 - ndRequestRoutineResultsByLocalIdentifier
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-58 ni.com ndRequestRoutineResultsByLocalIdentifier Purpose Executes the RequestRoutineResultsByLocalIdentifier service. Returns results from an ECU routine. Format long ndRequestRoutineResultsByLoca...
Page 224 - ndRequestSeed
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-60 ni.com ndRequestSeed Purpose Executes the SecurityAccess service to retrieve a seed from the ECU. Format long ndRequestSeed( TD1 *diagRef, unsigned char accessMode, unsigned char seedOut[], long ...
Page 228 - ndStartDiagnosticSession
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-64 ni.com ndStartDiagnosticSession Purpose Executes the StartDiagnosticSession service. The ECU is set up in a specific diagnostic mode. Format long ndStartDiagnosticSession( TD1 *diagRef, unsigned ...
Page 230 - ndStartRoutineByLocalIdentifier
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-66 ni.com ndStartRoutineByLocalIdentifier Purpose Executes the StartRoutineByLocalIdentifier service. Executes a routine on the ECU. Format long ndStartRoutineByLocalIdentifier( TD1 *diagRef, unsign...
Page 232 - ndStopDiagnosticSession
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-68 ni.com ndStopDiagnosticSession Purpose Executes the StopDiagnosticSession service. Returns the ECU to normal mode. Format long ndStopDiagnosticSession( TD1 *diagRef, LVBoolean *success); Input di...
Page 239 - ndWriteMemoryByAddress
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-75 Automotive Diagnostic Command Set User Manual ndWriteMemoryByAddress Purpose Executes the WriteMemoryByAddress service. Writes data to the ECU memory. Format long ndWriteMemoryByAddress( TD1 *diagRef, unsig...
Page 241 - ndUDSClearDiagnosticInformation
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-77 Automotive Diagnostic Command Set User Manual UDS (DiagOnCAN) Services ndUDSClearDiagnosticInformation Purpose Executes the UDS ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (...
Page 243 - ndUDSCommunicationControl
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-79 Automotive Diagnostic Command Set User Manual ndUDSCommunicationControl Purpose Executes the UDS CommunicationControl service. Switches transmission and/or reception of the normal communication messages (us...
Page 245 - ndUDSControlDTCSetting
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-81 Automotive Diagnostic Command Set User Manual ndUDSControlDTCSetting Purpose Executes the UDS ControlDTCSetting service. Modifies Diagnostic Trouble Code (DTC) behavior. Format long ndUDSControlDTCSetting( ...
Page 246 - ndUDSDiagnosticSessionControl
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-82 ni.com ndUDSDiagnosticSessionControl Purpose Executes the UDS DiagnosticSessionControl service. The ECU is set up in a specific diagnostic mode. Format long ndUDSDiagnosticSessionControl( TD1 *di...
Page 247 - ndUDSECUReset; Hex
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-83 Automotive Diagnostic Command Set User Manual ndUDSECUReset Purpose Executes the UDS ECUReset service. Resets the ECU. Format long ndUDSECUReset( TD1 *diagRef, unsigned char mode, LVBoolean *success); Input...
Page 251 - ndUDSReadDataByIdentifier
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-87 Automotive Diagnostic Command Set User Manual ndUDSReadDataByIdentifier Purpose Executes the UDS ReadDataByIdentifier service. Reads an ECU data record. Format long ndUDSReadDataByIdentifier( TD1 *diagRef, ...
Page 253 - ndUDSReadMemoryByAddress
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-89 Automotive Diagnostic Command Set User Manual ndUDSReadMemoryByAddress Purpose Executes the UDS ReadMemoryByAddress service. Reads data from the ECU memory. Format long ndUDSReadMemoryByAddress( TD1 *diagRe...
Page 255 - ndUDSReportDTCBySeverityMaskRecord
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-91 Automotive Diagnostic Command Set User Manual ndUDSReportDTCBySeverityMaskRecord Purpose Executes the ReportDTCBySeverityMaskRecord subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads...
Page 258 - ndUDSReportDTCByStatusMask
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-94 ni.com ndUDSReportDTCByStatusMask Purpose Executes the ReportDTCByStatusMask subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs). F...
Page 261 - ndUDSReportSeverityInformationOfDTC
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-97 Automotive Diagnostic Command Set User Manual ndUDSReportSeverityInformationOfDTC Purpose Executes the ReportSeverityInformationOfDTC subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Rea...
Page 264 - ndUDSReportSupportedDTCs
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-100 ni.com ndUDSReportSupportedDTCs Purpose Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads all supported Diagnostic Trouble Codes (DTCs)....
Page 267 - ndUDSRequestSeed
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-103 Automotive Diagnostic Command Set User Manual ndUDSRequestSeed Purpose Executes the UDS SecurityAccess service to retrieve a seed from the ECU. Format long ndUDSRequestSeed( TD1 *diagRef, unsigned char acc...
Page 269 - ndUDSRoutineControl
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-105 Automotive Diagnostic Command Set User Manual ndUDSRoutineControl Purpose Executes the UDS RoutineControl service. Executes a routine on the ECU. Format long ndUDSRoutineControl( TD1 *diagRef, unsigned sho...
Page 273 - ndUDSTesterPresent
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-109 Automotive Diagnostic Command Set User Manual ndUDSTesterPresent Purpose Executes the UDS TesterPresent service. Keeps the ECU in diagnostic mode. Format long ndUDSTesterPresent( TD1 *diagRef, LVBoolean *r...
Page 275 - ndUDSWriteDataByIdentifier
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-111 Automotive Diagnostic Command Set User Manual ndUDSWriteDataByIdentifier Purpose Executes the UDS WriteDataByIdentifier service. Writes a data record to the ECU. Format long ndUDSWriteDataByIdentifier( TD1...
Page 277 - ndUDSWriteMemoryByAddress
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-113 Automotive Diagnostic Command Set User Manual ndUDSWriteMemoryByAddress Purpose Executes the UDS WriteMemoryByAddress service. Writes data to the ECU memory. Format long ndUDSWriteMemoryByAddress( TD1 *dia...
Page 279 - ndOBDClearEmissionRelatedDiagnosticInformation
Chapter 6 Automotive Diagnostic Command Set API for C © National Instruments Corporation 6-115 Automotive Diagnostic Command Set User Manual OBD (On-Board Diagnostics) Services ndOBDClearEmissionRelatedDiagnosticInformation Purpose Executes the OBD Clear Emission Related Diagnostic Information servi...
Page 280 - ndOBDRequestControlOfOnBoardDevice
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-116 ni.com ndOBDRequestControlOfOnBoardDevice Purpose Executes the OBD Request Control Of On-Board Device service. Modifies ECU I/O port behavior. Format long ndOBDRequestControlOfOnBoardDevice( TD1...
Page 282 - ndOBDRequestCurrentPowertrainDiagnosticData
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-118 ni.com ndOBDRequestCurrentPowertrainDiagnosticData Purpose Executes the OBD Request Current Powertrain Diagnostic Data service. Reads an ECU data record. Format long ndOBDRequestCurrentPowertrai...
Page 284 - ndOBDRequestEmissionRelatedDTCs
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-120 ni.com ndOBDRequestEmissionRelatedDTCs Purpose Executes the OBD Request Emission Related DTCs service. Reads all emission-related Diagnostic Trouble Codes (DTCs). Format long ndOBDRequestEmissio...
Page 286 - ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-122 ni.com ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle Purpose Executes the OBD Request Emission Related DTCs During Current Drive Cycle service. Reads the emission-related Diagnostic Tro...
Page 288 - ndOBDRequestOnBoardMonitoringTestResults
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-124 ni.com ndOBDRequestOnBoardMonitoringTestResults Purpose Executes the OBD Request On-Board Monitoring Test Results service. Reads an ECU test data record. Format long ndOBDRequestOnBoardMonitorin...
Page 290 - ndOBDRequestPowertrainFreezeFrameData
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-126 ni.com ndOBDRequestPowertrainFreezeFrameData Purpose Executes the OBD Request Powertrain Freeze Frame Data service. Reads an ECU data record stored while a diagnostic trouble code occurred. Form...
Page 292 - ndOBDRequestVehicleInformation
Chapter 6 Automotive Diagnostic Command Set API for C Automotive Diagnostic Command Set User Manual 6-128 ni.com ndOBDRequestVehicleInformation Purpose Executes the OBD Request Vehicle Information service. Reads a set of information data from the ECU. Format long ndOBDRequestVehicleInformation( TD1 ...