CAN Automotive Diagnostic Command Set User Manual Automotive Diagnostic Command Set User Manual December 2007 372139B-01
Support Worldwide Technical Support and Product Information ni.
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. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period.
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 (for use in industrial-commercial locations only) or Class B (for use in residential or commercial locations). All National Instruments (NI) products are FCC Class A products.
Contents About This Manual Conventions ...................................................................................................................xi Related Documentation..................................................................................................xii Chapter 1 Introduction KWP2000 (Key Word Protocol 2000)...........................................................................1-1 Transport Protocol ..............................................................................
Contents Visual C++ 6 ................................................................................................... 3-2 Other Programming Languages ...................................................................... 3-2 Debugging an Application............................................................................................. 3-3 Chapter 4 Using the Automotive Diagnostic Command Set Structure of the Automotive Diagnostic Command Set ................................................
Contents ReadDTCByStatus.vi ......................................................................................5-48 ReadECUIdentification.vi ...............................................................................5-51 ReadMemoryByAddress.vi .............................................................................5-53 ReadStatusOfDTC.vi.......................................................................................5-55 RequestRoutineResultsByLocalIdentifier.vi ..........................
Contents Chapter 6 Automotive Diagnostic Command Set API for C Section Headings ........................................................................................................... 6-1 Purpose............................................................................................................ 6-1 Format ............................................................................................................. 6-1 Input and Output .............................................................
Contents ndTesterPresent ...............................................................................................6-71 ndWriteDataByLocalIdentifier........................................................................6-73 ndWriteMemoryByAddress ............................................................................6-75 UDS (DiagOnCAN) Services ........................................................................................6-77 ndUDSClearDiagnosticInformation ...........................
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 Diagnostic Command Set function reference for LabVIEW-based and C-based APIs. Conventions The following conventions appear in this manual: » The » symbol leads you through nested menu items and dialog box options to a final action.
About This Manual 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 (CAN) for High-Speed Communication • CAN Specification Version 2.0, 1991, Robert Bosch GmbH., Postfach 106050, D-70049 Stuttgart 1 • CiA Draft Standard 102, Version 2.
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. Several diagnostic protocols such as KWP2000 and UDS standardize the format of the services to be executed, but those standards leave a large amount of room for manufacturer-specific extensions.
Chapter 1 Introduction 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 message into pieces that can be transferred over the network and reassembles those pieces to recover the original message. KWP2000 runs on CAN on various transport protocols such as ISO TP (ISO 15765-2), TP 1.6, TP 2.0 (Volkswagen), and SAE J1939-21.
Chapter 1 Introduction as second byte, and a ResponseCode as third byte. The only exception to this format is the negative response to an EscapeCode service; here, the third byte is an echo of the user-defined service code, and the fourth byte is the ResponseCode. The KWP2000 standard partly defines the ResponseCodes, but there is room left for manufacturer-specific extensions. For some of the ResponseCodes, KWP2000 defines an error handling procedure.
Chapter 1 Introduction 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 tester. The transfer can be either single value or periodic, with a slow, medium, or fast transfer rate. The transfer rates are manufacturer specific; you can use the SetDataRates service to set them, but this setting is manufacturer specific.
Chapter 1 Introduction UDS (Unified Diagnostic Services) The UDS protocol has become a de facto standard in automotive diagnostic applications. It is standardized as ISO 15765-3. UDS describes the implementation of various diagnostic services you can access through the protocol. As UDS uses messages of variable byte lengths, a transport protocol is necessary on layers with only a well defined (short) message length, such as CAN.
Chapter 1 Introduction 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. Note The Negative Response Message is usually a three-byte message: it has the Negative Response ServiceId (0x7F) as first byte, an echo of the original ServiceId as second byte, and a ResponseCode as third byte.
Installation and Configuration 2 This chapter explains how to install and configure the Automotive Diagnostic Command Set. Installation This section discusses the Automotive Diagnostic Command Set installation for Microsoft Windows. You need administrator rights to install the Automotive Diagnostic Command Set on your computer. Note Follow these steps to install the Automotive Diagnostic Command Set software: 1. Insert the Automotive Diagnostic Command Set CD into the CD-ROM drive. 2.
Chapter 2 Installation and Configuration 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 Automotive Diagnostic Command Set functions in your application development environment. LabVIEW Real-Time (RT) Configuration LabVIEW Real-Time (RT) combines easy-to-use LabVIEW programming with the power of real-time systems.
Application Development 3 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 development determines how to access the Automotive Diagnostic Command Set APIs. LabVIEW Automotive Diagnostic Command Set functions and controls are in the LabVIEW palettes. In LabVIEW, the Automotive Diagnostic Command Set palette is in the top-level NI Measurements palette.
Chapter 3 Application Development 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 description is in comments at the top of the .c file. Visual C++ 6 The Automotive Diagnostic Command Set software supports Microsoft Visual C/C++ 6.
Chapter 3 Application Development 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/C++ 6. For more detailed information, refer to Microsoft documentation. The following C language code fragment shows how to call Win32 LoadLibrary to load the Automotive Diagnostic Command Set API DLL: #include #include "nidiagcs.
4 Using the Automotive Diagnostic Command Set Structure of the Automotive Diagnostic Command Set Diagnostic Services Layer KWP2000 Services OBD(OnBoard Diag) Services UDS (DiagOnCAN) Services Auxiliary Routines Diagnostic Transport Layer Auxiliary Routines Service Execution Connection Management Transport Protocols ISO TP (ISO 15765-2) VW TP 2.0 CAN Layer (C++ DLL) NI-CAN 2.3.
Chapter 4 Using the Automotive Diagnostic Command Set 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, UDS (DiagOnCAN), and OBD (On-Board Diagnostics). • The second layer implements general routines involving opening and closing diagnostic communication connections, connecting and disconnecting to/from an ECU, and executing a diagnostic service on byte level.
Chapter 4 Using the Automotive Diagnostic Command Set General Programming Model Open Diagnostic VW TP? Yes VWTP Connect No Execute a Diagnostic Service VW TP? Yes Periodically Execute VWTP ConnectionTest No No Done? Yes VW TP? Yes VWTP Disconnect No Close Diagnostic First, you must open a diagnostic communication link. This involves initializing the CAN port and defining communication parameters such as the baud rate and CAN identifiers on which the diagnostic communication takes place.
Chapter 4 Using the Automotive Diagnostic Command Set 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 channel established before closing. Available Diagnostic Services The standards on automotive diagnostic define many different services for many purposes. Unfortunately, most services leave a large amount of room for manufacturer-specific variants and extensions.
Automotive Diagnostic Command Set API for LabVIEW 5 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 alphabetically in four categories: general functions, KWP2000 services, UDS (DiagOnCAN) services, and OBD (On-Board Diagnostics) services. Section Headings The following are section headings found in the Automotive Diagnostic Command Set API for LabVIEW VIs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 ClearDiagnosticInformation.vi Executes the ClearDiagnosticInformation service and clears selected Diagnostic Trouble Codes (DTCs). Close Diagnostic.vi Closes a diagnostic session. ControlDTCSetting.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW (Continued) Function Purpose EnableNormalMessageTransmission.vi Executes the EnableNormalMessageTransmission service. The ECU starts transmitting its regular communication messages (usually CAN messages). InputOutputControlByLocalIdentifier.vi Executes the InputOutputControlByLocalIdentifier service. Modifies the ECU I/O port behavior.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW (Continued) Function Purpose OBD Request Powertrain Freeze Frame Data.vi Executes the OBD Request Powertrain Freeze Frame Data service. Reads a data record from the ECU that has been stored while a Diagnostic Trouble Code occurred. OBD Request Supported PIDs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW (Continued) Function Purpose SendKey.vi Executes the SecurityAccess service to send a key to the ECU. StartDiagnosticSession.vi Executes the StartDiagnosticSession service. Sets up the ECU in a specific diagnostic mode. StartRoutineByLocalIdentifier.vi Executes the StartRoutineByLocalIdentifier service. Executes a routine on the ECU. StopDiagnosticSession.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW (Continued) Function Purpose UDS ReadDataByIdentifier.vi Executes the UDS ReadDataByIdentifier service. Reads a data record from the ECU. UDS ReadMemoryByAddress.vi Executes the UDS ReadMemoryByAddress service. Reads data from the ECU memory. UDS ReportDTCBySeverityMaskRecord.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW (Continued) Function Purpose UDS WriteDataByIdentifier.vi Executes the UDS WriteDataByIdentifier service. Writes a data record to the ECU. UDS WriteMemoryByAddress.vi Executes the UDS WriteMemoryByAddress service. Writes data to the ECU memory. VWTP Connect.vi Establishes a connection channel to an ECU using the VW TP 2.0. VWTP Connection Test.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Convert from Phys.vi Purpose Converts a physical data value into a binary representation using a type descriptor. Format Input type descriptor is a cluster that specifies the conversion of the physical value to its binary representation: Start Byte gives the start byte of the binary representation. For Convert from Phys.vi, this value is ignored and always assumed to be 0. Byte Length is the binary representation byte length.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 instances of Convert from Phys.vi. Description Data input to diagnostic services (for example, WriteDataByLocalIdentifier.vi) is usually a byte stream of binary data. If you have a description of the data input (for example, byte 3 and 4 are engine RPM scaled as .
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Convert to Phys.vi Purpose Converts a binary representation of a value into its physical value using a type descriptor. Format Input type descriptor is a cluster that specifies the conversion of the binary representation to its physical value: Start Byte gives the binary representation start byte in the data in record. Byte Length is the binary representation byte length.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Description Data output from diagnostic services (for example, ReadDataByLocalIdentifier.vi) is usually a byte stream of binary data. If you have a description of the data output (for example, byte 3 and 4 are engine RPM scaled as .25 * × RPM in Motorola representation), you can use Convert to Phys.vi to extract the physical value from the byte stream by filling an appropriate type descriptor cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Create Extended CAN IDs.vi Purpose Creates diagnostic CAN IDs according to ISO 15765-2. Format Input addressing mode specifies whether the ECU is physically or functionally addressed. transport protocol specifies whether normal or mixed mode addressing is used. source address is the logical address of the host (diagnostic tester). target address is the ECU logical address.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Diag Get Property.vi Purpose Gets a diagnostic global internal parameter. Format Input property ID defines the parameter whose value is to be retrieved. You can create the values using an Enum control. 0 Timeout Diag Command is the timeout in milliseconds the master waits for the response to a diagnostic request message. The default is 1000 ms.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 = –1), the master sends an OVERLOAD frame instead of a WAIT, and reception is aborted. The default is 0 for maximum speed. 7 Time between Waits (T_W) is the number of milliseconds the master waits after sending a WAIT frame. The default is 25.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Diag Set Property.vi Purpose Sets a diagnostic global internal parameter. Format Input property ID defines the parameter whose value is to be retrieved. You can create the values using an Enum control. 0 Timeout Diag Command is the timeout in milliseconds the master waits for the response to a diagnostic request message. The default is 1000 ms.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 = –1), the master sends an OVERLOAD frame instead of a WAIT, and reception is aborted. The default is 0 for maximum speed. 7 Time between Waits (T_W) is the number of milliseconds the master waits after sending a WAIT frame. The default is 25.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Diagnostic Service.vi 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.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW DTC to String.vi Purpose Returns a string representation (such as P1234) for a 2-byte Diagnostic Trouble Code (DTC). Format Input DTC (num) is the DTC number as returned in the clusters of ReadDTCByStatus.vi, ReadStatusOfDTC.vi, UDS ReportDTCBySeverityMaskRecord.vi, UDS ReportDTCByStatusMask.vi, UDS ReportSeverityInformationOfDTC.vi, UDS ReportSupportedDTCs.vi, OBD Request Emission Related DTCs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD Open.vi Purpose Opens an OBD-II diagnostic session on a CAN port. Format Input CAN interface specifies the CAN interface on which the diagnostic communication should take place. The values are CAN0, CAN1, and so on. baudrate is the diagnostic communication baud rate. error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a cluster containing all necessary diagnostic session information. Wire this cluster as a handle to all subsequent diagnostic VIs and close it using Close Diagnostic.vi. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Open Diagnostic.vi Purpose Opens a diagnostic session on a CAN port. Communication to the ECU is not yet started. Format Input CAN interface specifies the CAN interface on which the diagnostic communication should take place. The values are CAN0, CAN1, and so on. baudrate is the diagnostic communication baud rate. transport protocol specifies the transport protocol for transferring the diagnostic service messages over the CAN network.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW VWTP Connect.vi Purpose Establishes a connection channel to an ECU using the VW TP 2.0. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. channel ID defines the CAN identifier on which the ECU responds for this connection.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW VWTP Connection Test.vi Purpose Maintains a connection channel to an ECU using the VW TP 2.0. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW VWTP Disconnect.vi Purpose Terminates a connection channel to an ECU using the VW TP 2.0. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW KWP2000 Services ClearDiagnosticInformation.vi Purpose Executes the ClearDiagnosticInformation service and clears selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 2. Status Byte Length indicates the number of bytes the ECU sends for each DTC’s status. The default is 1.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW group of DTC specifies the group of Diagnostic Trouble Codes to be cleared. The following values have a special meaning, and you can specify them through a ring control: 0x0000 All powertrain DTCs 0x4000 All chassis DTCs 0x8000 All body DTCs 0xC000 All network-related DTCs 0xFF00 All DTCs error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ControlDTCSetting.vi Purpose Executes the ControlDTCSetting service and modifies the generation behavior of selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 2. Status Byte Length indicates the number of bytes the ECU sends for each DTC’s status. The default is 1.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW group of DTC specifies the group of Diagnostic Trouble Codes to be controlled. The following values have a special meaning, and you can specify them through a ring control: 0x0000 All powertrain DTCs 0x4000 All chassis DTCs 0x8000 All body DTCs 0xC000 All network-related DTCs 0xFF00 All DTCs error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW DisableNormalMessageTransmission.vi Purpose Executes the DisableNormalMessageTransmission service. The ECU no longer transmits its regular communication messages (usually CAN messages). Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ECUReset.vi Purpose Executes the ECUReset service. Resets the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW EnableNormalMessageTransmission.vi Purpose Executes the EnableNormalMessageTransmission service. The ECU starts transmitting its regular communication messages (usually CAN messages). Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW InputOutputControlByLocalIdentifier.vi Purpose Executes the InputOutputControlByLocalIdentifier service. Modifies ECU I/O port behavior. Format Input data in defines application-specific data for this service. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ReadDataByLocalIdentifier.vi Purpose Executes the ReadDataByLocalIdentifier service. Reads a data record from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. local ID defines the local identifier of the data to be read. The values are application specific.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the data record from the ECU. If you know the record data description, you can interpret this record using Convert from Phys.vi. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ReadDTCByStatus.vi Purpose Executes the ReadDiagnosticTroubleCodesByStatus service. Reads selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 2. Status Byte Length indicates the number of bytes the ECU sends for each DTC’s status. The default is 1.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW mode defines the type of DTCs to be read. The values are application specific. The usual values are: 2: AllIdentified 3: AllSupported group of DTC specifies the group of Diagnostic Trouble Codes to be read.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Status is the DTC status. Usually, this is a bit field with the following meaning: Bit Meaning 0 testFailed 1 testFailedThisMonitoringCycle 2 pendingDTC 3 confirmedDTC 4 testNotCompletedSinceLastClear 5 testFailedSinceLastClear 6 testNotCompletedThisMonitoringCycle 7 warningIndicatorRequested Add Data contains optional additional data for this DTC.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ReadECUIdentification.vi Purpose Executes the ReadECUIdentification service. Returns ECU identification data. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. mode indicates the type of identification information to be returned. The values are application specific.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ReadMemoryByAddress.vi Purpose Executes the ReadMemoryByAddress service. Reads data from the ECU memory. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. address defines the memory address from which data are to be read.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. Data out returns the memory data from the ECU. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW ReadStatusOfDTC.vi Purpose Executes the ReadStatusOfDiagnosticTroubleCodes service. Reads selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 2. Status Byte Length indicates the number of bytes the ECU sends for each DTC’s status. The default is 1.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW group of DTC specifies the group of Diagnostic Trouble Codes to be read. The following values have a special meaning, and you can specify them through a ring control: 0x0000 All powertrain DTCs 0x4000 All chassis DTCs 0x8000 All body DTCs 0xC000 All network-related DTCs 0xFF00 All DTCs error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Status is the DTC status. Usually, this is a bit field with the following meaning: Bit Meaning 0 testFailed 1 testFailedThisMonitoringCycle 2 pendingDTC 3 confirmedDTC 4 testNotCompletedSinceLastClear 5 testFailedSinceLastClear 6 testNotCompletedThisMonitoringCycle 7 warningIndicatorRequested Add Data contains optional additional data for this DTC.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW RequestRoutineResultsByLocalIdentifier.vi Purpose Executes the RequestRoutineResultsByLocalIdentifier service. Returns results from a routine on the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 the routine. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW RequestSeed.vi Purpose Executes the SecurityAccess service to retrieve a seed from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. access mode indicates the security level to be granted. The values are application specific. This is an odd number, usually 1.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. seed out returns the seed from the ECU. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW SendKey.vi Purpose Executes the SecurityAccess service to send a key to the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. access mode indicates the security level to be granted. The values are application specific. This is an even number, usually 2.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW StartDiagnosticSession.vi Purpose Executes the StartDiagnosticSession service. Sets up the ECU in a specific diagnostic mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. mode indicates the diagnostic mode into which the ECU is brought.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW StartRoutineByLocalIdentifier.vi Purpose Executes the StartRoutineByLocalIdentifier service. Executes a routine on the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. local ID defines the local identifier of the routine to be started.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 the routine. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW StopDiagnosticSession.vi Purpose Executes the StopDiagnosticSession service. Returns the ECU to normal mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. error in is a cluster that describes error conditions occurring before the VI executes.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW StopRoutineByLocalIdentifier.vi Purpose Executes the StopRoutineByLocalIdentifier service. Stops a routine on the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. local ID defines the local identifier of the routine to be stopped.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 the routine. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW TesterPresent.vi Purpose Executes the TesterPresent service. Keeps the ECU in diagnostic mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. response required? indicates whether the ECU answers this service (TRUE, default) or not (FALSE).
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW WriteDataByLocalIdentifier.vi Purpose Executes the WriteDataByLocalIdentifier service. Writes a data record to the ECU. Format Input data in defines the data record written to the ECU. If you know the record data description, you can use Convert from Phys.vi to generate this record. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS (DiagOnCAN) Services UDS ClearDiagnosticInformation.vi Purpose Executes the UDS ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 2. Status Byte Length indicates the number of bytes the ECU sends for each DTC’s status.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW group of DTC specifies the group of Diagnostic Trouble Codes to be cleared. The values are application specific. The following value has a special meaning, and you can specify it through a ring control: 0xFFFFFF All DTCs 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 further details about this service, refer to the ISO 15765-3 standard. Automotive Diagnostic Command Set User Manual 5-80 ni.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS CommunicationControl.vi Purpose Executes the UDS CommunicationControl service. Use this VI to switch transmission and/or reception of the normal communication messages (usually CAN messages) on or off. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ControlDTCSetting.vi Purpose Executes the UDS ControlDTCSetting service. Modifies Diagnostic Trouble Code (DTC) generation behavior. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. data in specifies application-specific data that control DTC generation.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS DiagnosticSessionControl.vi Purpose Executes the UDS DiagnosticSessionControl service. Sets up the ECU in a specific diagnostic mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. mode indicates the diagnostic mode into which the ECU is brought.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ECUReset.vi Purpose Executes the UDS ECUReset service. Resets the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS InputOutputControlByIdentifier.vi Purpose Executes the UDS InputOutputControlByIdentifier service. Modifies ECU I/O port behavior. Format Input data in defines application specific data for this service. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ReadDataByIdentifier.vi Purpose Executes the UDS ReadDataByIdentifier service. Reads a data record from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. ID defines the identifier of the data to be read. The values are application specific.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the data record from the ECU. If you know the record data description, you can use Convert to Phys.vi to interpret this record. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ReadMemoryByAddress.vi Purpose Executes the UDS ReadMemoryByAddress service. Reads data from the ECU memory. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. address defines the memory address from which data are to be read.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the ECU memory data. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ReportDTCBySeverityMaskRecord.vi Purpose Executes the ReportDTCBySeverityMaskRecord subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 3 for UDS.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW severity mask defines the status of DTCs to be read. The values are application specific. status defines the status of DTCs to be read. The values are application specific. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 6 testNotCompletedThisMonitoringCycle 7 warningIndicatorRequested Add Data contains optional additional data for this DTC. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ReportDTCByStatusMask.vi Purpose Executes the ReportDTCByStatusMask subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 3 for UDS.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ReportSeverityInformationOfDTC.vi Purpose Executes the ReportSeverityInformationOfDTC subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 3 for UDS.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW DTC mask record defines the status of DTCs to be read. The values are application specific. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Add Data contains optional additional data for this DTC. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS ReportSupportedDTCs.vi Purpose Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads all supported Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 3 for UDS.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS RequestSeed.vi Purpose Executes the UDS SecurityAccess service to retrieve a seed from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. access mode indicates the security level to be granted. The values are application specific.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS RoutineControl.vi Purpose Executes the UDS RoutineControl service. Executes a routine on the ECU. Format Input mode defines the service operation mode. You can obtain the values from a ring control: 1: Start Routine 2: Stop Routine 3: Request Routine Results Other values are application specific. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS SendKey.vi Purpose Executes the SecurityAccess service to send a key to the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. access mode indicates the security level to be granted. The values are application specific. This is an even number, usually 2.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS TesterPresent.vi Purpose Executes the UDS TesterPresent service. Keeps the ECU in diagnostic mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. response required? indicates whether the ECU answers this service (TRUE, default) or not (FALSE).
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS WriteDataByIdentifier.vi Purpose Executes the UDS WriteDataByIdentifier service. Writes a data record to the ECU. Format Input data in defines the data record to be written to the ECU. If you know the the data description record, you can use Convert from Phys.vi to generate this record. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW UDS WriteMemoryByAddress.vi Purpose Executes the UDS WriteMemoryByAddress service. Writes data to the ECU memory. Format Input data in defines the memory block to be written to the ECU. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD (On-Board Diagnostics) Services OBD Clear Emission Related Diagnostic Information.vi Purpose Executes the OBD Clear Emission Related Diagnostic Information service. Clears emission-related Diagnostic Trouble Codes (DTCs) in the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 Input data in defines application-specific data for this service. diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns application-specific data for this service. success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD Request Current Powertrain Diagnostic Data.vi Purpose Executes the OBD Request Current Powertrain Diagnostic Data service. Reads a data record from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. PID defines the parameter identifier of the data to be read.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the ECU data record. If you know the record data description, you can use Convert from Phys.vi to interpret this record. You can obtain the description from the SAE J1979 standard. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD Request Emission Related DTCs.vi Purpose Executes the OBD Request Emission Related DTCs service. Reads all emission-related Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC. The default is 2. Status Byte Length indicates the number of bytes the ECU sends for each DTC’s status.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW success? indicates successful receipt of a positive response message for this diagnostic service. 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 Diagnostic Trouble Codes (DTCs) that occurred during the current (or last completed) drive cycle. Format Input DTC descriptor is a cluster that describes the DTC records the ECU delivers: DTC Byte Length indicates the number of bytes the ECU sends for each DTC.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW For OBD, this field usually does not contain valid information. Add Data contains optional additional data for this DTC. Usually, this does not contain valid information (refer to DTC descriptor). success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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 the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the ECU data record. If you know the record data description, you can use Convert from Phys.vi to interpret this record. You can obtain the description from the SAE J1979 standard. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD Request Powertrain Freeze Frame Data.vi Purpose Executes the OBD Request Powertrain Freeze Frame Data service. Reads an ECU data record stored while a Diagnostic Trouble Code occurred. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the ECU data record. If you know the record data description, you can use Convert from Phys.vi to interpret this record. You can obtain the description from the SAE J1979 standard. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD Request Supported PIDs.vi Purpose Executes the OBD Request Current Powertrain Diagnostic Data service to retrieve the valid PID values for this service. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW 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.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW OBD Request Vehicle Information.vi Purpose Executes the OBD Request Vehicle Information service. Reads a set of information data from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is not necessary to manually manipulate the elements of this cluster. info type defines the type of information to be read.
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW Output diag ref out is a copy of diag ref in. You can wire it to subsequent diagnostic VIs. data out returns the vehicle information from the ECU. You can obtain the description from the SAE J1979 standard. success? indicates successful receipt of a positive response message for this diagnostic service. error out describes error conditions. If the error in cluster indicated an error, the error out cluster contains the same information.
6 Automotive Diagnostic Command Set API for C This chapter lists the Automotive Diagnostic Command Set API functions and describes their format, purpose, and parameters. Unless otherwise stated, each Automotive Diagnostic Command Set function suspends execution of the calling thread until it completes. The functions are listed alphabetically in four categories: general functions, KWP2000 services, UDS (DiagOnCAN) services, and OBD (On-Board Diagnostics) services.
Chapter 6 Automotive Diagnostic Command Set API for C List of Data Types The following data types are used with the Automotive Diagnostic Command Set API for C functions. Table 6-1.
Chapter 6 Automotive Diagnostic Command Set API for C List of Functions The following table contains an alphabetical list of the Automotive Diagnostic Command Set API functions. Table 6-2. Functions for the Automotive Diagnostic Command Set for C Function Purpose ndClearDiagnosticInformation Executes the ClearDiagnostic Information service. Clears selected Diagnostic Trouble Codes (DTCs). ndCloseDiagnostic Closes a diagnostic session. ndControlDTCSetting Executes the ControlDTCSetting service.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndDisableNormalMessageTransmission Executes the DisableNormalMessage Transmission service. The ECU no longer transmits its regular communication messages (usually CAN messages). ndDTCToString Returns a string representation (such as P1234) for a 2-byte diagnostic trouble code (DTC). ndECUReset Executes the ECUReset service. Resets the ECU.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndOBDOpen Opens a diagnostic session on a CAN port for OBD-II. ndOBDRequestControlOfOnBoardDevice Executes the OBD Request Control Of On-Board Device service. Modifies ECU I/O port behavior. ndOBDRequestCurrentPowertrainDiagnosticData Executes the OBD Request Current Powertrain Diagnostic Data service. Reads an ECU data record.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndOBDRequestPowertrainFreezeFrameData Executes the OBD Request Powertrain Freeze Frame Data service. Reads an ECU data record stored while a diagnostic trouble code occurred. ndOBDRequestVehicleInformation Executes the OBD Request Vehicle Information service. Reads a set of information data from the ECU.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndReadStatusOfDTC Executes the ReadStatusOfDiagnostic TroubleCodes service. Reads selected Diagnostic Trouble Codes (DTCs). ndRequestRoutineResultsByLocalIdentifier Executes the RequestRoutineResultsBy LocalIdentifier service. Returns results from an ECU routine. ndRequestSeed Executes the SecurityAccess service to retrieve a seed from the ECU.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndStopRoutineByLocalIdentifier Executes the StopRoutineByLocal Identifier service. Stops a routine on the ECU. ndTesterPresent Executes the TesterPresent service. Keeps the ECU in diagnostic mode. ndUDSClearDiagnosticInformation Executes the UDS ClearDiagnostic Information service. Clears selected Diagnostic Trouble Codes (DTCs).
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndUDSInputOutputControlByIdentifier Executes the UDS InputOutputControlBy Identifier service. Modifies ECU I/O port behavior. ndUDSReadDataByIdentifier Executes the UDS ReadDataByIdentifier service. Reads an ECU data record. ndUDSReadMemoryByAddress Executes the UDS ReadMemoryByAddress service. Reads data from the ECU memory.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndUDSReportSeverityInformationOfDTC Executes the ReportSeverity InformationOfDTC subfunction of the UDS ReadDiagnosticTrouble CodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs) are read. ndUDSReportSupportedDTCs Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTrouble CodeInformation service.
Chapter 6 Automotive Diagnostic Command Set API for C Table 6-2. Functions for the Automotive Diagnostic Command Set for C (Continued) Function Purpose ndUDSWriteMemoryByAddress Executes the UDS WriteMemoryByAddress service. Writes data to the ECU memory. ndVWTPConnect Establishes a connection channel to an ECU using the VW TP 2.0. ndVWTPConnectionTest Maintains a connection channel to an ECU using the VW TP 2.0. ndVWTPDisconnect Terminates a connection channel to an ECU using the VW TP 2.0.
Chapter 6 Automotive Diagnostic Command Set API for C General Functions ndCloseDiagnostic Purpose Closes a diagnostic session. Format long ndCloseDiagnostic( TD1 *diagRefIn); Input diagRefIn 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. Output Return Value The return value indicates the function call status as a signed 32-bit integer.
Chapter 6 Automotive Diagnostic Command Set API for C ndConvertFromPhys Purpose Converts a physical data value into a binary representation using a type descriptor.
Chapter 6 Automotive Diagnostic Command Set API for C Output dataOut Points to the byte array to be filled with the binary representation of value. len On input, len must contain the dataOut array length. On return, it contains the number of valid data bytes in the dataOut array. Description Data input to diagnostic services (for example, ndWriteDataByLocalIdentifier) is usually a byte array of binary data. If you have the data input description (for example, byte 3 and 4 are engine RPM scaled as .
Chapter 6 Automotive Diagnostic Command Set API for C ndConvertToPhys Purpose Converts a binary representation of a value into its physical value using a type descriptor.
Chapter 6 Automotive Diagnostic Command Set API for C dataIn Points to the byte array that contains the binary representation of value. len Must contain the dataIn array length. Output value The physical value converted from the binary representation. Description Data output from diagnostic services (for example, ndReadDataByLocalIdentifier) is usually a byte stream of binary data. If you have a description of the data output (for example, byte 3 and 4 are engine RPM scaled as .
Chapter 6 Automotive Diagnostic Command Set API for C ndCreateExtendedCANIds Purpose Creates diagnostic CAN identifiers according to ISO 15765-2.
Chapter 6 Automotive Diagnostic Command Set API for C Output transmitID The generated CAN identifier for sending diagnostic request messages from the host to the ECU. receiveID The generated CAN identifier for sending diagnostic response messages from the ECU to the host.
Chapter 6 Automotive Diagnostic Command Set API for C 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.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndDTCToString Purpose Returns a string representation (such as P1234) for a 2-byte diagnostic trouble code (DTC).
Chapter 6 Automotive Diagnostic Command Set API for C ndGetProperty Purpose Gets a diagnostic global internal parameter. Format void ndGetProperty( unsigned short propertyID, unsigned long *propertyValue); Input propertyID Defines the parameter whose value is to be retrieved: 0 Timeout Diag Command is the timeout in milliseconds the master waits for the response to a diagnostic request message. The default is 1000 ms.
Chapter 6 8 Automotive Diagnostic Command Set API for C Fill CAN Frames returns whether a CAN frame is transmitted with 8 bytes or less. 0: Short CAN frames are sent with DLC < 8 (default). 1: Short CAN frames are filled to 8 bytes with Fill Byte (necessary for OBD, for example). 9 Fill Byte returns the CAN frame content if filled with defined data or random data bytes. 0–255: Byte is used optionally to fill short CAN frames. 256: Short CAN frames are filled optionally with random bytes.
Chapter 6 Automotive Diagnostic Command Set API for C 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 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description ndOBDOpen opens a diagnostic communication channel to an ECU for OBD-II. The CAN port specified as input is initialized, and a handle to it is stored (among other internal data) into the diagRefOut struct, which serves as reference for further diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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.
Chapter 6 Automotive Diagnostic Command Set API for C Output diagRefOut A struct containing all necessary information about the diagnostic session. This is passed as a handle to all subsequent diagnostic functions, and you must close it using ndCloseDiagnostic. 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 the function did not perform the expected behavior.
Chapter 6 Automotive Diagnostic Command Set API for C ndSetProperty Purpose Sets a diagnostic global internal parameter. Format void ndSetProperty( unsigned short propertyID, unsigned long propertyValue); Input propertyID Defines the parameter whose value is to be modified: 0 Timeout Diag Command is the timeout in milliseconds the master waits for the response to a diagnostic request message. The default is 1000 ms.
Chapter 6 8 Automotive Diagnostic Command Set API for C Fill CAN Frames specifies whether a CAN frame is transmitted with 8 bytes or less. 0: Short CAN frames are sent with DLC < 8 (default). 1: Short CAN frames are filled to 8 bytes with Fill Byte (necessary for OBD, for example). 9 Fill Byte specifies the CAN frame content, filled with defined data or random data. 0–255: Byte is used optionally to fill short CAN frames. 256: Short CAN frames are filled optionally with random bytes.
Chapter 6 Automotive Diagnostic Command Set API for C ndStatusToString Purpose Returns a description for an error code. Format void ndStatusToString( long errorCode, char message[], long *len); Input errorCode The status code (return value) of any other diagnostic functions. Output message Returns a descriptive string for the error code. len On input, len must contain the message array length. On return, it contains the number of valid data bytes in the message array.
Chapter 6 Automotive Diagnostic Command Set API for C Status Code Use Status Code Definition Negative Error—Function did not perform the expected behavior. Positive Warning—Function performed as expected, but a condition arose that may require attention. Zero Success—Function completed successfully. The application code should check the status returned from every Automotive Diagnostic Command Set function.
Chapter 6 Automotive Diagnostic Command Set API for C 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); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description For the VW TP 2.0, you must establish a connection to the ECU before any diagnostic communication can occur. This function sets up a unique communication channel to an ECU that you can use in subsequent diagnostic service requests. You must maintain the communication link thus created by periodically (at least once a second) calling ndVWTPConnectionTest.
Chapter 6 Automotive Diagnostic Command Set API for C ndVWTPConnectionTest Purpose Maintains a connection channel to an ECU using the VW TP 2.0. Format long ndVWTPConnectionTest( TD1 *diagRef); 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.
Chapter 6 Automotive Diagnostic Command Set API for C ndVWTPDisconnect Purpose Terminates a connection channel to an ECU using the VW TP 2.0. Format long ndVWTPDisconnect( TD1 *diagRef); 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. Output Return Value The return value indicates the function call status as a signed 32-bit integer.
Chapter 6 Automotive Diagnostic Command Set API for C KWP2000 Services ndClearDiagnosticInformation Purpose Executes the ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (DTCs). Format long ndClearDiagnosticInformation( TD1 *diagRef, unsigned short groupOfDTC, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function clears the diagnostic information on the ECU memory. groupOfDTC specifies the type of diagnostic trouble codes to be cleared on the ECU memory. For further details about this service, refer to the ISO 14230-3 standard.
Chapter 6 Automotive Diagnostic Command Set API for C ndControlDTCSetting Purpose Executes the ControlDTCSetting service. Modifies the generation behavior of selected Diagnostic Trouble Codes (DTCs). Format long ndControlDTCSetting( TD1 *diagRef, unsigned short groupOfDTC, unsigned char dataIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Output success Indicates successful receipt of a positive response message for this diagnostic service. 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 the function did not perform the expected behavior.
Chapter 6 Automotive Diagnostic Command Set API for C ndDisableNormalMessageTransmission Purpose Executes the DisableNormalMessageTransmission service. The ECU no longer transmits its regular communication messages (usually CAN messages). Format long ndDisableNormalMessageTransmission( TD1 *diagRef, LVBoolean *requireResponse, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C ndECUReset Purpose Executes the ECUReset service. Resets the ECU. Format long ndECUReset( TD1 *diagRef, unsigned char mode, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Output success Indicates successful receipt of a positive response message for this diagnostic service. 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 the function did not perform the expected behavior.
Chapter 6 Automotive Diagnostic Command Set API for C ndEnableNormalMessageTransmission Purpose Executes the EnableNormalMessageTransmission service. The ECU starts transmitting its regular communication messages (usually CAN messages). Format long ndEnableNormalMessageTransmission( TD1 *diagRef, LVBoolean *requireResponse, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C ndInputOutputControlByLocalIdentifier Purpose Executes the InputOutputControlByLocalIdentifier service. Modifies the ECU I/O port behavior.
Chapter 6 Automotive Diagnostic Command Set API for C Output dataOut Returns application-specific data for this service. len2 On input, len2 must contain the dataOut array length. On return, it contains the number of valid data bytes in the dataOut array. success Indicates successful receipt of a positive response message for this diagnostic service. Return Value The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully.
Chapter 6 Automotive Diagnostic Command Set API for C ndReadDataByLocalIdentifier Purpose Executes the ReadDataByLocalIdentifier service. Reads an ECU data record. Format long ndReadDataByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function requests data record values from the ECU identified by the localID parameter. For further details about this service, refer to the ISO 14230-3 standard.
Chapter 6 Automotive Diagnostic Command Set API for C ndReadDTCByStatus Purpose Executes the ReadDiagnosticTroubleCodesByStatus service. Reads selected Diagnostic Trouble Codes (DTCs). Format long ndReadDTCByStatus( TD1 *diagRef, unsigned char mode, unsigned short groupOfDTC, TD3 *DTCDescriptor, TD4 DTCs[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C DTCDescriptor A struct that describes the DTC records the ECU delivers: typedef struct { long DTCByteLength; long StatusByteLength; long AddDataByteLength; unsigned short ByteOrder; } TD3; DTCByteLength indicates the number of bytes the ECU sends for each DTC. The default is 2. StatusByteLength indicates the number of bytes the ECU sends for each DTC’s status. The default is 1.
Chapter 6 Automotive Diagnostic Command Set API for C 6 testNotCompletedThisMonitoringCycle 7 warningIndicatorRequested AddData contains optional additional data for this DTC. Usually, this does not contain valid information (refer to DTCDescriptor). len On input, len must contain the DTCs array length in elements. On return, it contains the number of valid elements in the DTCs array. success Indicates successful receipt of a positive response message for this diagnostic service.
Chapter 6 Automotive Diagnostic Command Set API for C ndReadECUIdentification Purpose Executes the ReadECUIdentification service. Returns ECU identification data. Format long ndReadECUIdentification( TD1 *diagRef, unsigned char mode, unsigned char dataOut[], long *len, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function requests identification data from the ECU. mode identifies the type of identification data requested. The ECU returns identification data that dataOut can access. The dataOut format and definition are vehicle manufacturer specific. For further details about this service, refer to the ISO 14230-3 standard. Automotive Diagnostic Command Set User Manual 6-52 ni.
Chapter 6 Automotive Diagnostic Command Set API for C ndReadMemoryByAddress Purpose Executes the ReadMemoryByAddress service. Reads data from the ECU memory. Format long ndReadMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char size, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndReadStatusOfDTC Purpose Executes the ReadStatusOfDiagnosticTroubleCodes service. Reads selected Diagnostic Trouble Codes (DTCs). Format long ndReadStatusOfDTC( TD1 *diagRef, unsigned short groupOfDTC, TD3 *DTCDescriptor, TD4 DTCs[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C StatusByteLength indicates the number of bytes the ECU sends for each DTC’s status. The default is 1. AddDataByteLength indicates the number of bytes the ECU sends for each DTC’s additional data. Usually, there are no additional data, so the default is 0.
Chapter 6 Automotive Diagnostic Command Set API for C len On input, len must contain the DTCs array length in elements. On return, it contains the number of valid elements in the DTCs array. success Indicates successful receipt of a positive response message for this diagnostic service. Return Value The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully.
Chapter 6 Automotive Diagnostic Command Set API for C ndRequestRoutineResultsByLocalIdentifier Purpose Executes the RequestRoutineResultsByLocalIdentifier service. Returns results from an ECU routine. Format long ndRequestRoutineResultsByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function requests results (for example, exit status information) referenced by localID and generated by the routine executed in the ECU memory. For further details about this service, refer to the ISO 14230-3 standard.
Chapter 6 Automotive Diagnostic Command Set API for C 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 *len, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description The usual procedure for getting a security access to the ECU is as follows: 1. Request a seed from the ECU using ndRequestSeed with access mode = n. 2. From the seed, compute a key for the ECU on the host. 3. Send the key to the ECU using ndSendKey with access mode = n + 1. 4. The security access is granted if the ECU validates the key sent. Otherwise, an error is returned.
Chapter 6 Automotive Diagnostic Command Set API for C ndSendKey Purpose Executes the SecurityAccess service to send a key to the ECU. Format long ndSendKey( TD1 *diagRef, unsigned char accessMode, unsigned char keyIn[], long len, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description The usual procedure for getting a security access to the ECU is as follows: 1. Request a seed from the ECU using ndRequestSeed with access mode = n. 2. From the seed, compute a key for the ECU on the host. 3. Send the key to the ECU using ndSendKey with access mode = n + 1. 4. The security access is granted if the ECU validates the key sent. Otherwise, an error is returned.
Chapter 6 Automotive Diagnostic Command Set API for C ndStartDiagnosticSession Purpose Executes the StartDiagnosticSession service. The ECU is set up in a specific diagnostic mode. Format long ndStartDiagnosticSession( TD1 *diagRef, unsigned char mode, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function enables different ECU diagnostic modes. The possible diagnostic modes are not defined in ISO 14230 and are application specific. A diagnostic session starts only if communication with the ECU is established. For more details about starting communication, refer to ISO 14230-2. If no diagnostic session is requested after ndOpenDiagnostic, a default session is enabled automatically in the ECU.
Chapter 6 Automotive Diagnostic Command Set API for C ndStartRoutineByLocalIdentifier Purpose Executes the StartRoutineByLocalIdentifier service. Executes a routine on the ECU. Format long ndStartRoutineByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigned char dataIn[], long len, unsigned char dataOut[], long *len2, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndStopDiagnosticSession Purpose Executes the StopDiagnosticSession service. Returns the ECU to normal mode. Format long ndStopDiagnosticSession( TD1 *diagRef, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C ndStopRoutineByLocalIdentifier Purpose Executes the StopRoutineByLocalIdentifier service. Stops a routine on the ECU. Format long ndStopRoutineByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigned char dataIn[], long len, unsigned char dataOut[], long *len2, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndTesterPresent Purpose Executes the TesterPresent service. Keeps the ECU in diagnostic mode. Format long ndTesterPresent( TD1 *diagRef, LVBoolean *requireResponse, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C The TesterPresent service is this “keep alive” signal. It does not affect any other ECU operation. Keep calling ndTesterPresent within the ECU timeout period if no other service is executed. Automotive Diagnostic Command Set User Manual 6-72 ni.
Chapter 6 Automotive Diagnostic Command Set API for C ndWriteDataByLocalIdentifier Purpose Executes the WriteDataByLocalIdentifier service. Writes a data record to the ECU. Format long ndWriteDataByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigned char dataIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function performs the WriteDataByLocalIdentifier service and writes RecordValues (data values) to the ECU. dataIn identifies the data values to be transmitted. The vehicle manufacturer must ensure the ECU conditions are met when performing this service. Typical use cases are clearing nonvolatile memory, resetting learned values, setting option content, setting the Vehicle Identification Number, or changing calibration values.
Chapter 6 Automotive Diagnostic Command Set API for C ndWriteMemoryByAddress Purpose Executes the WriteMemoryByAddress service. Writes data to the ECU memory. Format long ndWriteMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char size, unsigned char dataIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention. Use the ndStatusToString function to obtain a descriptive string for the return value. Description This VI performs the KWP2000 WriteDataByAddress service and writes RecordValues (data values) to the ECU. address and size identify the data.
Chapter 6 Automotive Diagnostic Command Set API for C UDS (DiagOnCAN) Services ndUDSClearDiagnosticInformation Purpose Executes the UDS ClearDiagnosticInformation service. Clears selected Diagnostic Trouble Codes (DTCs). Format long ndUDSClearDiagnosticInformation( TD1 *diagRef, unsigned long groupOfDTC, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function clears the diagnostic information on the ECU memory. Depending on the value of groupOfDTC, the ECU is requested to clear the corresponding DTCs. The groupOfDTC values are application specific. For further details about this service, refer to the ISO 15765-3 standard. Automotive Diagnostic Command Set User Manual 6-78 ni.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSCommunicationControl Purpose Executes the UDS CommunicationControl service. Switches transmission and/or reception of the normal communication messages (usually CAN messages) on or off. Format long ndUDSCommunicationControl( TD1 *diagRef, unsigned char type, unsigned char communicationType, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention. Use the ndStatusToString function to obtain a descriptive string for the return value. Description This function executes the UDS CommunicationControl service and switches transmission and/or reception of the normal communication messages (usually CAN messages) on or off.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSControlDTCSetting Purpose Executes the UDS ControlDTCSetting service. Modifies Diagnostic Trouble Code (DTC) behavior. Format long ndUDSControlDTCSetting( TD1 *diagRef, unsigned char type, unsigned char dataIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSDiagnosticSessionControl Purpose Executes the UDS DiagnosticSessionControl service. The ECU is set up in a specific diagnostic mode. Format long ndUDSDiagnosticSessionControl( TD1 *diagRef, unsigned char mode, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSECUReset Purpose Executes the UDS ECUReset service. Resets the ECU. Format long ndUDSECUReset( TD1 *diagRef, unsigned char mode, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function requests the ECU to perform an ECU reset effectively based on the mode parameter value content. The vehicle manufacturer determines when the positive response message is sent. Depending the value of mode, the corresponding ECU reset event is executed as a hard reset, key off/on reset, soft reset, or other reset. For further details about this service, refer to the ISO 15765-3 standard.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSInputOutputControlByIdentifier Purpose Executes the UDS InputOutputControlByIdentifier service. Modifies ECU I/O port behavior.
Chapter 6 Automotive Diagnostic Command Set API for C Output dataOut Returns application-specific data for this service. len2 On input, len2 must contain the dataOut array length. On return, it contains the number of valid data bytes in the dataOut array. success Indicates successful receipt of a positive response message for this diagnostic service. Return Value The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSReadDataByIdentifier Purpose Executes the UDS ReadDataByIdentifier service. Reads an ECU data record. Format long ndUDSReadDataByIdentifier( TD1 *diagRef, unsigned short ID, unsigned char dataOut[], long *len, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function requests data record values from the ECU identified by the ID parameter. For further details about this service, refer to the ISO 15765-3 standard. Automotive Diagnostic Command Set User Manual 6-88 ni.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSReadMemoryByAddress Purpose Executes the UDS ReadMemoryByAddress service. Reads data from the ECU memory. Format long ndUDSReadMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char size, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSReportDTCBySeverityMaskRecord Purpose Executes the ReportDTCBySeverityMaskRecord subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs).
Chapter 6 Automotive Diagnostic Command Set API for C AddDataByteLength indicates the number of bytes the ECU sends for each DTC’s additional data. For this subfunction, the default is 2. ByteOrder indicates the byte ordering for multibyte items: 0: MSB_FIRST (Motorola), default 1: LSB_FIRST (Intel) This function interprets the response byte stream according to this description and returns the resulting DTC records in the DTCs struct array.
Chapter 6 Automotive Diagnostic Command Set API for C len On input, len must contain the DTCs array length in elements. On return, it contains the number of valid elements in the DTCs array. success Indicates successful receipt of a positive response message for this diagnostic service. Return Value The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSReportDTCByStatusMask Purpose Executes the ReportDTCByStatusMask subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs).
Chapter 6 Automotive Diagnostic Command Set API for C ByteOrder indicates the byte ordering for multibyte items: 0: MSB_FIRST (Motorola), default 1: LSB_FIRST (Intel) This function interprets the response byte stream according to this description and returns the resulting DTC records in the DTCs struct array. Output statusAvailMask An application-specific value returned for all DTCs.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSReportSeverityInformationOfDTC Purpose Executes the ReportSeverityInformationOfDTC subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Trouble Codes (DTCs) are read.
Chapter 6 Automotive Diagnostic Command Set API for C ByteOrder indicates the byte ordering for multibyte items: 0: MSB_FIRST (Motorola), default 1: LSB_FIRST (Intel) This function interprets the response byte stream according to this description and returns the resulting DTC records in the DTCs struct array. Output statusAvailMask An application-specific value returned for all DTCs.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSReportSupportedDTCs Purpose Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads all supported Diagnostic Trouble Codes (DTCs).
Chapter 6 Automotive Diagnostic Command Set API for C ByteOrder indicates the byte ordering for multibyte items: 0: MSB_FIRST (Motorola), default 1: LSB_FIRST (Intel) This function interprets the response byte stream according to this description and returns the resulting DTC records in the DTCs struct array. Output statusAvailMask An application-specific value returned for all DTCs.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSRequestSeed Purpose Executes the UDS SecurityAccess service to retrieve a seed from the ECU. Format long ndUDSRequestSeed( TD1 *diagRef, unsigned char accessMode, unsigned char seedOut[], long *len, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description The usual procedure for getting a security access to the ECU is as follows: 1. Request a seed from the ECU using ndUDSRequestSeed with access mode = n. 2. From the seed, compute a key for the ECU on the host. 3. Send the key to the ECU using ndUDSSendKey with access mode = n + 1. 4. The security access is granted if the ECU validates the key sent. Otherwise, an error is returned.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSRoutineControl Purpose Executes the UDS RoutineControl service. Executes a routine on the ECU. Format long ndUDSRoutineControl( TD1 *diagRef, unsigned short ID, unsigned char mode, unsigned char dataIn[], long len, unsigned char dataOut[], long *len2, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Output dataOut Returns application-specific output parameters from the routine. len2 On input, len2 must contain the dataOut array length. On return, it contains the number of valid data bytes in the dataOut array. success Indicates successful receipt of a positive response message for this diagnostic service. Return Value The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSSendKey Purpose Executes the UDS SecurityAccess service to send a key to the ECU. Format long ndUDSSendKey( TD1 *diagRef, unsigned char accessMode, unsigned char keyIn[], long len, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C Description The usual procedure for getting a security access to the ECU is as follows: 1. Request a seed from the ECU using ndUDSRequestSeed with access mode = n. 2. From the seed, compute a key for the ECU on the host. 3. Send the key to the ECU using ndUDSSendKey with access mode = n + 1. 4. The security access is granted if the ECU validates the key sent. Otherwise, an error is returned.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSTesterPresent Purpose Executes the UDS TesterPresent service. Keeps the ECU in diagnostic mode. Format long ndUDSTesterPresent( TD1 *diagRef, LVBoolean *requireResponse, LVBoolean *success); 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.
Chapter 6 Automotive Diagnostic Command Set API for C The TesterPresent service is this “keep alive” signal. It does not affect any other ECU operation. Keep calling ndUDSTesterPresent within the ECU timeout period if no other service is executed. Automotive Diagnostic Command Set User Manual 6-110 ni.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSWriteDataByIdentifier Purpose Executes the UDS WriteDataByIdentifier service. Writes a data record to the ECU. Format long ndUDSWriteDataByIdentifier( TD1 *diagRef, unsigned short ID, unsigned char dataIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Description This function performs the UDS service WriteDataByIdentifier and writes RecordValues (data values) into the ECU. dataIn identifies the data. The vehicle manufacturer must ensure the ECU conditions are met when performing this service. Typical use cases are clearing nonvolatile memory, resetting learned values, setting option content, setting the Vehicle Identification Number, or changing calibration values.
Chapter 6 Automotive Diagnostic Command Set API for C ndUDSWriteMemoryByAddress Purpose Executes the UDS WriteMemoryByAddress service. Writes data to the ECU memory. Format long ndUDSWriteMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char size, unsigned char dataIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention. Use the ndStatusToString function to obtain a descriptive string for the return value. Description This function performs the UDS service WriteMemoryByAddress and writes RecordValues (data values) into the ECU. address and size identify the data.
Chapter 6 Automotive Diagnostic Command Set API for C OBD (On-Board Diagnostics) Services ndOBDClearEmissionRelatedDiagnosticInformation Purpose Executes the OBD Clear Emission Related Diagnostic Information service. Clears emission-related diagnostic trouble codes (DTCs) in the ECU.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestControlOfOnBoardDevice Purpose Executes the OBD Request Control Of On-Board Device service. Modifies ECU I/O port behavior. Format long ndOBDRequestControlOfOnBoardDevice( TD1 *diagRef, unsigned char TID, unsigned char dataIn[], long len, unsigned char dataOut[], long *len2, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestCurrentPowertrainDiagnosticData Purpose Executes the OBD Request Current Powertrain Diagnostic Data service. Reads an ECU data record. Format long ndOBDRequestCurrentPowertrainDiagnosticData( TD1 *diagRef, unsigned char PID, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestEmissionRelatedDTCs Purpose Executes the OBD Request Emission Related DTCs service. Reads all emission-related Diagnostic Trouble Codes (DTCs). Format long ndOBDRequestEmissionRelatedDTCs( TD1 *diagRef, TD3 *DTCDescriptor, TD4 DTCs[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C Output DTCs Returns the resulting DTCs as an array of structs: typedef struct { unsigned long DTC; unsigned long Status; unsigned long AddData; } TD4; DTC is the resulting Diagnostic Trouble Code. For the default 2-byte DTCs, use ndDTCToString to convert this code to readable format as defined by SAE J2012. Status is the DTC status.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle Purpose Executes the OBD Request Emission Related DTCs During Current Drive Cycle service. Reads the emission-related Diagnostic Trouble Codes (DTCs) that occurred during the current (or last completed) drive cycle.
Chapter 6 Automotive Diagnostic Command Set API for C Output DTCs Returns the resulting DTCs as an array of structs: typedef struct { unsigned long DTC; unsigned long Status; unsigned long AddData; } TD4; DTC is the resulting Diagnostic Trouble Code. For the default 2-byte DTCs, use ndDTCToString to convert this code to readable format as defined by SAE J2012. Status is the DTC status.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestOnBoardMonitoringTestResults Purpose Executes the OBD Request On-Board Monitoring Test Results service. Reads an ECU test data record. Format long ndOBDRequestOnBoardMonitoringTestResults( TD1 *diagRef, unsigned char OBDMID, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestPowertrainFreezeFrameData Purpose Executes the OBD Request Powertrain Freeze Frame Data service. Reads an ECU data record stored while a diagnostic trouble code occurred.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Chapter 6 Automotive Diagnostic Command Set API for C ndOBDRequestVehicleInformation Purpose Executes the OBD Request Vehicle Information service. Reads a set of information data from the ECU. Format long ndOBDRequestVehicleInformation( TD1 *diagRef, unsigned char infoType, unsigned char *nItems, unsigned char dataOut[], long *len, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent diagnostic functions.
Chapter 6 Automotive Diagnostic Command Set API for C 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 the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Technical Support and Professional Services A Visit the following sections of the National Instruments Web site at ni.com for technical support and professional services: • Support—Online technical support resources at ni.
Index A UDS, 1-5 diagnostic service format, 1-5 diagnostic services, 1-5 external references, 1-6 using, 4-1 using with LabVIEW, 3-1 using with LabWindows/CVI, 3-1 using with other programming languages, 3-2 using with Visual C++ 6, 3-2 available diagnostic services, 4-4 application debugging, 3-3 application development, 3-1 Automotive Diagnostic Command Set API C, 6-1 LabVIEW, 5-1 API structure, 4-2 application development, 3-1 available diagnostic services, 4-4 choosing a programming language, 3-1 conf
Index ndUDSReportDTCBySeverityMask Record, 6-91 ndUDSReportDTCByStatusMask, 6-94 ndUDSReportSeverityInformationOf DTC, 6-97 ndUDSReportSupportedDTCs, 6-100 ndUDSRequestSeed, 6-103 ndUDSRoutineControl, 6-105 ndUDSSendKey, 6-107 ndUDSTesterPresent, 6-109 ndUDSWriteDataByIdentifier, 6-111 ndUDSWriteMemoryByAddress, 6-113 ndVWTPConnect, 6-32 ndVWTPConnectionTest, 6-34 ndVWTPDisconnect, 6-35 ndWriteDataByLocalIdentifier, 6-73 ndWriteMemoryByAddress, 6-75 OBD (On-Board Diagnostics) services, 6-115 UDS (DiagOnCAN
Index diagnostic services KWP2000, 1-2 UDS, 1-5 diagnostic services available, 4-4 diagnostic tools (NI resources), A-1 Diagnostic Trouble Codes KWP2000, 1-4 DisableNormalMessageTransmission.vi, 5-38 documentation conventions used in manual, xi NI resources, A-1 related documentation, xii drivers (NI resources), A-1 DTC to String.
Index StopDiagnosticSession.vi, 5-68 StopRoutineByLocalIdentifier.vi, 5-70 TesterPresent.vi, 5-72 UDS (DiagOnCAN) services, 5-78 UDS ClearDiagnosticInformation.vi, 5-78 UDS CommunicationControl.vi, 5-81 UDS ControlDTCSetting.vi, 5-83 UDS DiagnosticSessionControl.vi, 5-85 UDS ECUReset.vi, 5-87 UDS InputOutputControlByIdentifier.vi, 5-89 UDS ReadDataByIdentifier.vi, 5-91 UDS ReadMemoryByAddress.vi, 5-93 UDS ReportDTCBySeverityMaskRecord.vi, 5-95 UDS ReportDTCByStatusMask.
Index N ndSetProperty, 6-28 ndStartDiagnosticSession, 6-64 ndStartRoutineByLocalIdentifier, 6-66 ndStatusToString, 6-30 ndStopDiagnosticSession, 6-68 ndStopRoutineByLocalIdentifier, 6-69 ndTesterPresent, 6-71 ndUDSClearDiagnosticInformation, 6-77 ndUDSCommunicationControl, 6-79 ndUDSControlDTCSetting, 6-81 ndUDSDiagnosticSessionControl, 6-82 ndUDSECUReset, 6-83 ndUDSInputOutputControlByIdentifier, 6-85 ndUDSReadDataByIdentifier, 6-87 ndUDSReadMemoryByAddress, 6-89 ndUDSReportDTCBySeverityMaskRecord, 6-91
Index S OBD Clear Emission Related Diagnostic Information.vi, 5-119 OBD Open.vi, 5-22 OBD Request Control Of On-Board Device.vi, 5-121 OBD Request Current Powertrain Diagnostic Data.vi, 5-123 OBD Request Emission Related DTCs During Current Drive Cycle.vi, 5-128 OBD Request Emission Related DTCs.vi, 5-125 OBD Request On-Board Monitoring Test Results.vi, 5-131 OBD Request Powertrain Freeze Frame Data.vi, 5-133 OBD Request Supported PIDs.vi, 5-135 On-Board Diagnostic, 1-6 Open Diagnostic.
Index V UDS ReportDTCBySeverityMaskRecord.vi, 5-95 UDS ReportDTCByStatusMask.vi, 5-98 UDS ReportSeverityInformationOfDTC.vi, 5-101 UDS ReportSupportedDTCs.vi, 5-104 UDS RequestSeed.vi, 5-107 UDS RoutineControl.vi, 5-109 UDS SendKey.vi, 5-111 UDS TesterPresent.vi, 5-113 UDS WriteDataByIdentifier.vi, 5-115 UDS WriteMemoryByAddress.vi, 5-117 Unified Diagnostic Services, 1-5 © National Instruments Corporation Visual C++ 6, using with Automotive Diagnostic Command Set, 3-2 VWTP Connect.