Manual National Instruments 372139B-01

301 pages 1.77 mb
Download

Go to site of 301

Summary
  • National Instruments 372139B-01 - page 1

    CAN Automotive Diagnostic Co mmand Set User Manual Automotive Diagnostic Command Set User Manual December 2007 372139B-01 ...

  • National Instruments 372139B-01 - page 2

    Support Worldwide Technical Support and Product Info rmation ni.com National Instruments Corporate Headquarters 11500 North Mopac Expressway Aust in, Texas 78759-3504 USA Tel: 512 683 0100 Worldwide Offices Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 5050 9800, ...

  • National Instruments 372139B-01 - page 3

    Important Information Warranty The media on which you receive National Instru ments 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 eviden ced by receipts or other documentation. Nati onal Instruments will, at its option, repair or ...

  • National Instruments 372139B-01 - page 4

    Compliance Compliance with FCC/Canada Radio Frequency Interference Regulations Determining FCC Class The Federal Communications Commission (FCC) has rules to protect wireless co mmunications from inte rference. The FCC places digital electronics into two classes. These classes are known as Class A (for use in industrial-commercial locations onl y) ...

  • National Instruments 372139B-01 - page 5

    © National Instruments Cor poration v Automotive Diagnost ic Command Set User Manual Contents About This Manual Conventions ............ .............. .............. .............. .............. .............. ............... .............. .... x i Related Documentation ......... .............. .............. ................. .............. .. ...

  • National Instruments 372139B-01 - page 6

    Contents Automotive Diagnostic Comma nd Set User Manual vi ni.com Visual C++ 6 .................... .............. ........... .............. .............. .............. ............ 3-2 Other Programming Languages ................... .............. ................. .............. ...... 3-2 Debugging an Application ................ ............ ...

  • National Instruments 372139B-01 - page 7

    Contents © National Instruments Corpor ation vii Automotive Diagnostic Command Set User Manual ReadDTCByStatus.vi .............. .............. .............. .............. .............. .............. .. 5-48 ReadECUIdentification.vi ............. .............. .............. ................. .............. ....... 5-51 ReadMemoryByAddress.vi ...

  • National Instruments 372139B-01 - page 8

    Contents Automotive Diagnostic Comma nd Set User Manual viii ni.com Chapter 6 Automotive Diagnostic Command Set API for C Section Headings ........... .............. .............. .............. .............. .............. .............. ............ 6-1 Purpose ............ .............. .............. .............. .............. ........... ...

  • National Instruments 372139B-01 - page 9

    Contents © National Instruments Corporation ix Autom otive Diagnostic Command Set User Manual ndTesterPresent .............. ............... .............. .............. .............. .............. .......... 6-71 ndWriteDataByLocalIdentifier ........ .............. ............... ................. .............. .... 6-73 ndWriteMemoryByAddre ...

  • National Instruments 372139B-01 - page 10

    © National Instruments Corporation xi Autom otive Diagnostic Command Set User Manual About This Manual This manual provides instructions for using the Automotive Diagnostic Command Set. It contains inform ation about installation, configuration, and troubleshooting, and also contains Automotive Diagnostic Command Set function reference for LabVIEW ...

  • National Instruments 372139B-01 - page 11

    About This Manual Automotive Diagnostic Comma nd Set User Manual xii ni.com Related Documentation The following documents contain information that you mi ght find helpful as you read this manual: • ANSI/ISO Standard 11898-1993, Road Veh icles—Interchange of Digital Informati on—Controller Area Network (CAN) for High-Speed Communication • CA ...

  • National Instruments 372139B-01 - page 12

    © National Instruments Corpor ation 1-1 Automotive Diagnost ic Command Set User Manual 1 Introduction Diagnostics involve rem ote execution of routines, or services, o n ECUs. To execute a routine, you send a byte st ring as a request to an ECU, and the ECU usually answers with a response byte string. Several diagnostic protocols such as KWP2000 a ...

  • National Instruments 372139B-01 - page 13

    Chapter 1 Introduction Automotive Diagnostic Comma nd Set User Manual 1-2 ni.com T ransport Protocol As KWP2000 uses messages of variable byte lengths, a tr ansport protocol is necessary on layers with only a well defined (short) me ssage length, such as CAN. The transport protoco l split s a long KWP2000 message into pieces that can be transferred ...

  • National Instruments 372139B-01 - page 14

    Chapter 1 Introduction © National Instruments Corpor ation 1-3 Automotive Diagnost ic Command Set User Manual as second byte, and a ResponseCode as third byte. The only e xception to this format is the negati ve response to an EscapeCode servic e; here, the third byte is an echo of the user -defined service code, and the fourth byte is the Respons ...

  • National Instruments 372139B-01 - page 15

    Chapter 1 Introduction Automotive Diagnostic Comma nd Set User Manual 1-4 ni.com Measurements Use the ReadDataByLocal/CommonIden tifier services to access ECU data in a way similar to a DAQ list. A Local/Com monIdentifier describes a list of ECU quantities that are then transf erred from the ECU to th e tester. The transfer can be either single val ...

  • National Instruments 372139B-01 - page 16

    Chapter 1 Introduction © National Instruments Corpor ation 1-5 Automotive Diagnost ic Command Set User Manual UDS (Unified Diagnostic Ser vices) The UDS protocol has become a de fact o standard in automotive diagnostic applications. It is standardized as ISO 15765-3. UDS describes the implementation of vari ous diagnostic services you can access t ...

  • National Instruments 372139B-01 - page 17

    Chapter 1 Introduction Automotive Diagnostic Comma nd Set User Manual 1-6 ni.com Note Some parameters to both the Request and Positive Response Messages are optional. Each service defines these parameters. Also, the standard does not define all parameters. The Negati v e Response Message is usually a three-byte message: it has the Negati ve Respons ...

  • National Instruments 372139B-01 - page 18

    © National Instruments Corpor ation 2-1 Automotive Diagnost ic Command Set User Manual 2 Installation and Configuration This chapter explains how to in stall and configure the Automotive Diagnostic Command Set. Installation This section discusses the Automoti ve Diagnostic Command Set installation for Microsoft Windows. Note Y ou need administ rat ...

  • National Instruments 372139B-01 - page 19

    Chapter 2 Installation and Configuration Automotive Diagnostic Comma nd Set User Manual 2-2 ni.com Refer to Appendix A, Troubleshooting an d Common Questions , of the NI-CAN User Manual for information abo ut resolving hardware installation problems. When installatio n is complete, you can access the Automoti v e Diagnostic Command Set functions in ...

  • National Instruments 372139B-01 - page 20

    © National Instruments Corpor ation 3-1 Automotive Diagnost ic Command Set User Manual 3 Application Development This chapter explains how to develop an application using the Au tomotive Diagnostic Command Set API. Choosing the Programming Language The programming language you use for application deve lopment determines how to access the Automotiv ...

  • National Instruments 372139B-01 - page 21

    Chapter 3 Application Development Automotive Diagnostic Comma nd Set User Manual 3-2 ni.com LabWindows/CVI examples. The exam ples are in the LabWindows/CVI samplesAutomotive Diagnostic Comma nd Set directory. Each example includes a complete LabWindows/CVI project ( .prj file). The example description is in co mments at the top of the .c file. V ...

  • National Instruments 372139B-01 - page 22

    Chapter 3 Applicati on Development © National Instruments Corpor ation 3-3 Automotive Diagnost ic Command Set User Manual pointers to Automo tive Diagnostic Command Set functions in the application. The foll owing section describes how to use th e Win32 functions for C/C++ environments other th an Visual C/C++ 6. For more detailed information, ref ...

  • National Instruments 372139B-01 - page 23

    © National Instruments Corpor ation 4-1 Automotive Diagnost ic Command Set User Manual 4 Using the Automotive Diagnostic Command Set Structure of the Automotive Diagnostic Command Set Diagnostic Services Layer KWP2000 Services UDS (DiagOnCAN) Services OBD(OnBoard Diag) Services Auxiliary Routines Diagnostic T ranspor t Layer Connection Management ...

  • National Instruments 372139B-01 - page 24

    Chapter 4 Using th e Automotive Diagnostic Command Set Automotive Diagnostic Comma nd Set User Manual 4-2 ni.com The Automotive Diagnostic Command Set is structured into three layers of functionality: • The top layer implements three sets of diagn ostic services for the diagnostic protocols KWP20 00, UDS (DiagOnCAN), and OBD (On-Board Diagnost ic ...

  • National Instruments 372139B-01 - page 25

    Chapter 4 Using the Automo tive Diagnostic Command Set © National Instruments Corpor ation 4-3 Automotive Diagnost ic Command Set User Manual General Programming Model First, you must open a diagnostic comm unication link. This inv olves initializing the CAN port and defining communication par ameters such as the baud rate and CAN identifiers on w ...

  • National Instruments 372139B-01 - page 26

    Chapter 4 Using th e Automotive Diagnostic Command Set Automotive Diagnostic Comma nd Set User Manual 4-4 ni.com When you finish your diagnostic services, you must close the diagnostic communication lin k. This finally closes the CAN port. For the V W TP 2.0, you should disconn ect the communicati on channel established b efore closing. A vailable ...

  • National Instruments 372139B-01 - page 27

    © National Instruments Corpor ation 5-1 Automotive Diagnost ic Command Set User Manual 5 Automotive Diagnostic Command Set API for LabVIEW This chapter lists the LabVIEW VIs for the Automotive Diagnostic Command Set API and describes the format, purpose, and parameters for each VI. The VIs are listed a lphabetically in four categories: general fun ...

  • National Instruments 372139B-01 - page 28

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-2 ni.com List of VIs The follo wing table is an alphabetical list of the Automotiv e Diagnostic Comman d Set VIs. Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW Function Pur pose ClearDiagnosticInforma tion.vi Executes the ...

  • National Instruments 372139B-01 - page 29

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corpor ation 5-3 Automotive Diagnost ic Command Set User Manual EnableNormalMessageTransmission.vi Executes the EnableNormalMessageT ransmission service. The ECU starts transmitting its regular communic ation messages (usually CAN messages). InputOutput ControlByL ...

  • National Instruments 372139B-01 - page 30

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-4 ni.com OBD Request Powertrain Freeze Frame Data.vi Executes the OBD Request Po wertrain 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. ...

  • National Instruments 372139B-01 - page 31

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corpor ation 5-5 Automotive Diagnost ic Command Set User Manual SendKey.vi Executes the Security Access service to send a key to the ECU. StartDiagnosticSession.vi Executes the StartDiagnosticSession servi ce. Sets up the ECU in a specific diagnos tic mode. StartR ...

  • National Instruments 372139B-01 - page 32

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-6 ni.com UDS ReadDataByIdentifier.vi Executes the UDS ReadDataByIdentif ier service. Reads a data record from the ECU. UDS ReadMemoryByAddress.vi Executes the UDS ReadMemoryBy Address service. Reads data from the ECU memory . UDS ReportDTCB ...

  • National Instruments 372139B-01 - page 33

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corpor ation 5-7 Automotive Diagnost ic Command Set User Manual UDS WriteD ataByIdentif ier.vi Executes the UDS WriteDataByIdentif ier service. Writes a data record to the ECU. UDS WriteMemoryByAddress.vi Executes the UDS WriteMemoryBy Address service. Writes data ...

  • National Instruments 372139B-01 - page 34

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-8 ni.com General Functions Close Diagnostic.vi Purpose Closes a diagnostic session. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagn ostic VIs. Normally , ...

  • National Instruments 372139B-01 - page 35

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corpor ation 5-9 Automotive Diagnost ic Command Set User Manual Output error out describes error conditions. If the error in cluster indicated an error , the error out cluster contains the same information. Otherwi se, error out describes the error status of this ...

  • National Instruments 372139B-01 - page 36

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-10 ni.com Convert from Phys.vi Purpose Con verts a physical data value into a bina ry representation using a type descriptor . Format Input type descriptor is a cluster that specifies the con version of the physical value to its binary repr ...

  • National Instruments 372139B-01 - page 37

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-11 Autom otive Diagnostic Command Set User Manual Output data out i s the binary representati on of the physical value. If you build a record of multiple v alues, you can concatenate the outputs of se veral instances of Convert from Phys.vi . Descrip ...

  • National Instruments 372139B-01 - page 38

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-12 ni.com Convert to Phys.vi Purpose Con verts a binary representation of a v alue into its physical value using a type descript or . Format Input type descriptor is a cluster that specifies the con version of the binary representation to i ...

  • National Instruments 372139B-01 - page 39

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-13 Autom otive Diagnostic Command Set User Manual Description Data output from diagnosti c 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 ...

  • National Instruments 372139B-01 - page 40

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-14 ni.com Create Extended CAN IDs.vi Purpose Creates diagnostic CAN IDs according to ISO 15765-2. Format Input addressing mode specifi es whether the ECU is physically or fu nctionally addressed. transport protocol specifies whether normal ...

  • National Instruments 372139B-01 - page 41

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-15 Autom otive Diagnostic Command Set User Manual Diag Get Property .vi Purpose Gets a diagnostic global internal parameter . Format Input property ID defines the parameter whose v alu e is to be retrie ved. Y ou can create the v alues using an Enum ...

  • National Instruments 372139B-01 - page 42

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-16 ni.com 6 Wait Frames to Send (N_WAIT) is the number of W AIT frames the master sends e very time before a CTS frame is sent. If this v alue is set to a ne gati v e number (for e xample, 0xFFFFFFFF = –1), the master sends an O VERLOAD f ...

  • National Instruments 372139B-01 - page 43

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-17 Autom otive Diagnostic Command Set User Manual Diag Set Property . vi Purpose Sets a diagnostic g lobal internal parameter . Format Input property ID defines the parameter whose v alu e is to be retrie ved. Y ou can create the v alues using an Enu ...

  • National Instruments 372139B-01 - page 44

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-18 ni.com 6 Wait Frames to Send (N_WAIT) is the number of W AIT frames the master sends e very time before a CTS frame is sent. If this v alue is set to a ne gati v e number (for e xample, 0xFFFFFFFF = –1), the master sends an O VERLOAD f ...

  • National Instruments 372139B-01 - page 45

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-19 Autom otive Diagnostic Command Set User Manual Diagnostic Ser vice.vi Purpose Executes a generic diagnostic service. If a sp ecial service is not a v ailable through the KWP2000, UDS, or OBD service functions, you can build it using this VI. Forma ...

  • National Instruments 372139B-01 - page 46

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-20 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. error code is the error code sent with a negati ve response message. In addition, the error cluster indicates an error and giv es a more ...

  • National Instruments 372139B-01 - page 47

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-21 Autom otive Diagnostic Command Set User Manual DTC to String.vi Purpose Returns a string representation (such as P1234 ) for a 2-byte Diagno stic T rouble Code (DTC). Format Input DTC (num) is the DTC number as retu rned in the clusters of ReadDTC ...

  • National Instruments 372139B-01 - page 48

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-22 ni.com 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 v alues are CAN0, CAN1, and so on. baudrate ...

  • National Instruments 372139B-01 - page 49

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-23 Autom otive Diagnostic Command Set User Manual Output diag ref out is a cluster containing all necessary diagnostic session information. W ire this cluster as a handle to all subsequent diagnostic VIs and close it using Close Diagnostic.vi . error ...

  • National Instruments 372139B-01 - page 50

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-24 ni.com 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 ...

  • National Instruments 372139B-01 - page 51

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-25 Autom otive Diagnostic Command Set User Manual status i s T RU E i f a n e r r o r occurred. This VI is not ex ecuted when status is TR UE. code is the error code number identi fying an error . A value of 0 means success. A neg ativ e v alue means ...

  • National Instruments 372139B-01 - page 52

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-26 ni.com VWTP Connect.vi Purpose Establishes a connect ion 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 diagn ostic V ...

  • National Instruments 372139B-01 - page 53

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-27 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. error out describes error conditions. If the error in cluster indicated an error , the error out cluster c ...

  • National Instruments 372139B-01 - page 54

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-28 ni.com VWTP Connection T est.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 diagn o ...

  • National Instruments 372139B-01 - page 55

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-29 Autom otive Diagnostic Command Set User Manual code is the error code number identi fying an error . A value of 0 means success. A neg ativ e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the ...

  • National Instruments 372139B-01 - page 56

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-30 ni.com VWTP Disconnect.vi Purpose T erminates a conn ection 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 diagn osti ...

  • National Instruments 372139B-01 - page 57

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-31 Autom otive Diagnostic Command Set User Manual code is the error code number identi fying an error . A value of 0 means success. A neg ativ e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the ...

  • National Instruments 372139B-01 - page 58

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-32 ni.com KWP2000 Ser vices ClearDiagnosticInformation.vi Purpose Executes the ClearDiagnosticInfo rmation service and clears se lected Diagnostic T rouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC record ...

  • National Instruments 372139B-01 - page 59

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-33 Autom otive Diagnostic Command Set User Manual group of DTC specifies the group of Diagnostic T rouble Codes to be cleared. The follo wing values hav e a sp ecial meaning, a nd you can specify them through a ring control: 0x0000 All powertrain DTC ...

  • National Instruments 372139B-01 - page 60

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-34 ni.com code is the error code number identi fying an error . A value of 0 means success. A negati v e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the VI executed intended operation ...

  • National Instruments 372139B-01 - page 61

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-35 Autom otive Diagnostic Command Set User Manual ControlDTCSetting.vi Purpose Executes the ControlDTCSetting service and modifies the generation beha vior of selected Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a cluster that des ...

  • National Instruments 372139B-01 - page 62

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-36 ni.com group of DTC specifies the group of Diagnostic T rouble Codes to be controlled. The follo wing v alues ha v e a special meaning, and you can specify them through a ring contro l: 0x0000 All powertrain DTCs 0x4000 All chassis DTCs ...

  • National Instruments 372139B-01 - page 63

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-37 Autom otive Diagnostic Command Set User Manual code is the error code number identi fying an error . A value of 0 means success. A neg ativ e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the ...

  • National Instruments 372139B-01 - page 64

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-38 ni.com DisableNormalMessageT ransmission.vi Purpose Executes the Dis ableNormalMessageT ransmission service. The ECU no longer transmits its regular communication message s (usually CAN messages). Format Input diag ref in specifies the d ...

  • National Instruments 372139B-01 - page 65

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-39 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 66

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-40 ni.com 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 diagn ostic VIs. Normally , it is n ...

  • National Instruments 372139B-01 - page 67

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-41 Autom otive Diagnostic Command Set User Manual status i s T RU E i f a n e r r o r occurred. This VI is not ex ecuted when status is TR UE. code is the error code number identi fying an error . A value of 0 means success. A neg ativ e v alue means ...

  • National Instruments 372139B-01 - page 68

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-42 ni.com EnableNormalMessageT ransmission.vi Purpose Executes the EnableNormalMessage T ransmission service. The ECU starts transmitting it s regular communication message s (usually CAN messages). Format Input diag ref in specifies the di ...

  • National Instruments 372139B-01 - page 69

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-43 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 70

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-44 ni.com InputOutputControl ByLocalIdentifier .vi Purpose Executes the InputOutputControlByLocalIdentifier service. Modifies ECU I/O port beha vior . Format Input data in defi nes application-specific data for this service. diag ref in spe ...

  • National Instruments 372139B-01 - page 71

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-45 Autom otive Diagnostic Command Set User Manual code is the error code number identi fying an error . A value of 0 means success. A neg ativ e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the ...

  • National Instruments 372139B-01 - page 72

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-46 ni.com ReadDataByLocalIdentifier .vi Purpose Executes the ReadDataByLocalIdentif ier serv ice. Reads a data r ecord from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wire ...

  • National Instruments 372139B-01 - page 73

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-47 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out retu rns the data record from the ECU. If yo u know the record data description, you can interpre ...

  • National Instruments 372139B-01 - page 74

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-48 ni.com ReadDTCByStatus.vi Purpose Executes the ReadDiagnosticT roubleCodesByStatus service. Reads selected Diagnostic T rouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC records the ECU deliv ers: DTC B ...

  • National Instruments 372139B-01 - page 75

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-49 Autom otive Diagnostic Command Set User Manual mode defines the type of DTCs to be read. The v alues are application specific. The usual v alues are: 2: AllIdentified 3: AllSupported group of DTC specifies the group of Diagnostic Trouble Codes to ...

  • National Instruments 372139B-01 - page 76

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-50 ni.com Status is the DTC status. Usually , this is a bit f ield with the following meaning: Bit Meaning 0 testFailed 1 testFailedThisMonitoringCycle 2 pendingDTC 3 confirmedDTC 4 testNotCompletedSin ceLastClear 5 testFailedSinceLastClear ...

  • National Instruments 372139B-01 - page 77

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-51 Autom otive Diagnostic Command Set User Manual ReadECUIdentification.vi Purpose Executes the ReadECUIdentification servi ce. Returns ECU identif ication data. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Dia ...

  • National Instruments 372139B-01 - page 78

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-52 ni.com success? indicates successful receipt of a positi ve 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 informat ...

  • National Instruments 372139B-01 - page 79

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-53 Autom otive Diagnostic Command Set User Manual ReadMemor yByAddress.vi Purpose Executes the ReadMemoryBy Address servi ce. Reads data from the ECU memory . Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagno ...

  • National Instruments 372139B-01 - page 80

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-54 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. Data out returns the memory data from the ECU. success? indicates successful receipt of a positi ve response message for this diagnostic ...

  • National Instruments 372139B-01 - page 81

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-55 Autom otive Diagnostic Command Set User Manual ReadStatusOfDTC.vi Purpose Executes the ReadStatusOfDiagnosticT roubleCo des service. Reads selected Diagnostic T rouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes the DTC r ...

  • National Instruments 372139B-01 - page 82

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-56 ni.com group of DTC specifies the group of Diagnostic Trouble Codes to be read. The follo wing values hav e a special meaning, and you can specify them through a ring control: 0x0000 All powertrain DTCs 0x4000 All chassis DTCs 0x8000 All ...

  • National Instruments 372139B-01 - page 83

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-57 Autom otive Diagnostic Command Set User Manual 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 testNotCompletedSin ceLastCle ...

  • National Instruments 372139B-01 - page 84

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-58 ni.com RequestRoutineResu ltsByLocalIdentifier .vi Purpose Executes the RequestRoutineResul tsByLocalIdentif ier service. Returns results fro m a routine on the ECU. Format Input diag ref in specifies the diagnostic session handle, obtai ...

  • National Instruments 372139B-01 - page 85

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-59 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out r eturns application-specific output paramete rs from the routine. success? indicates successful ...

  • National Instruments 372139B-01 - page 86

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-60 ni.com RequestSeed.vi Purpose Executes the Security Access service to retrie ve a seed from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagn os ...

  • National Instruments 372139B-01 - page 87

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-61 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. seed out returns the seed from the ECU. success? indicates successful receipt of a positi ve response mess ...

  • National Instruments 372139B-01 - page 88

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-62 ni.com SendKey .vi Purpose Executes the Security Access service to send a ke y to the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired through subsequent diagn ostic VIs. N ...

  • National Instruments 372139B-01 - page 89

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-63 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 90

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-64 ni.com StartDiagnosticSession.vi Purpose Executes the StartDiagnosticSession service. Sets up the ECU in a sp ecific diagnostic mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and ...

  • National Instruments 372139B-01 - page 91

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-65 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 92

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-66 ni.com StartRoutineByLocalIdentifier .vi Purpose Executes the StartRoutineByLo calIdentif ier service. Execu tes a routine on the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and ...

  • National Instruments 372139B-01 - page 93

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-67 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out r eturns application-specific output paramete rs from the routine. success? indicates successful ...

  • National Instruments 372139B-01 - page 94

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-68 ni.com 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 subs ...

  • National Instruments 372139B-01 - page 95

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-69 Autom otive Diagnostic Command Set User Manual error out describes error conditions. If the error in cluster indicated an error , the error out cluster contains the same information. Otherwi se, error out describes the error status of this VI. sta ...

  • National Instruments 372139B-01 - page 96

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-70 ni.com StopRoutineByLoc alIdentifier .vi Purpose Executes the StopRoutineByLocalIdentif ier service. Stops a routine on the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired ...

  • National Instruments 372139B-01 - page 97

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-71 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out r eturns application-specific output paramete rs from the routine. success? indicates successful ...

  • National Instruments 372139B-01 - page 98

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-72 ni.com T esterPresent.vi Purpose Executes the T esterPresent 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 diagn ...

  • National Instruments 372139B-01 - page 99

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-73 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 100

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-74 ni.com WriteDataByLocalIdentifier .vi Purpose Executes the WriteDataByLocalIdentif ier serv ice. Writes a data record to the ECU. Format Input data in d efines the data record written to the ECU. I f you know the record data description, ...

  • National Instruments 372139B-01 - page 101

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-75 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 102

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-76 ni.com WriteMemoryByAddress.vi Purpose Executes the WriteMemoryBy Address servi ce. Writes data to the ECU memory . Format Input data in defines the memory block to b e written to th e ECU. diag ref in specifies the diagnostic session ha ...

  • National Instruments 372139B-01 - page 103

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-77 Autom otive Diagnostic Command Set User Manual Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error o ...

  • National Instruments 372139B-01 - page 104

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-78 ni.com UDS (DiagOnCAN) Ser vices UDS ClearDiagnosticInformation.vi Purpose Executes the UDS ClearDiagnostic Information service. Clears selected Diagnostic T rouble Codes (DTCs). Format Input DTC descriptor is a cluster that describes th ...

  • National Instruments 372139B-01 - page 105

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-79 Autom otive Diagnostic Command Set User Manual group of DTC specifies the group of Diagnostic T rouble Codes to be cleared. The v alues are application specific. The follo wing v alue has a special meaning, and you can speci fy it through a ring c ...

  • National Instruments 372139B-01 - page 106

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-80 ni.com Description This VI clears the diagnostic informat ion on the ECU memory . If the group of DTC parameter is present, the ECU is requested to clear all memory including th e DTCs. For further details about this service, refer to th ...

  • National Instruments 372139B-01 - page 107

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-81 Autom otive Diagnostic Command Set User Manual UDS CommunicationControl.vi Purpose Executes the UDS CommunicationCont rol service. Use this VI to switch transmi ssion and/or reception of the normal co mmunication messages (usually CAN messages) on ...

  • National Instruments 372139B-01 - page 108

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-82 ni.com code is the error code number identi fying an error . A value of 0 means success. A negati v e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the VI executed intended operation ...

  • National Instruments 372139B-01 - page 109

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-83 Autom otive Diagnostic Command Set User Manual UDS ControlDTCSetting.vi Purpose Executes the UDS ControlDTCSett ing service. Modifies Diagnostic Tr ouble Code (DTC) generation behavior . Format Input diag ref in specifies the diagnostic session ha ...

  • National Instruments 372139B-01 - page 110

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-84 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. ...

  • National Instruments 372139B-01 - page 111

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-85 Autom otive Diagnostic Command Set User Manual UDS DiagnosticSessionControl.vi Purpose Executes the UDS DiagnosticSessionControl ser vice. Sets up the ECU in a speci fic diagnostic mode. Format Input diag ref in specifies the diagnostic session ha ...

  • National Instruments 372139B-01 - page 112

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-86 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. ...

  • National Instruments 372139B-01 - page 113

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-87 Autom otive Diagnostic Command Set User Manual 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 subseque ...

  • National Instruments 372139B-01 - page 114

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-88 ni.com source identifies the VI where the error occurred. Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagno ...

  • National Instruments 372139B-01 - page 115

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-89 Autom otive Diagnostic Command Set User Manual UDS InputOutputControlByIdentifier .vi Purpose Executes the UDS InputOutputControlByIdentifier service. Modifies ECU I/O port behavior . Format Input data in defines application specifi c data for thi ...

  • National Instruments 372139B-01 - page 116

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-90 ni.com code is the error code number identi fying an error . A value of 0 means success. A negati v e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the VI executed intended operation ...

  • National Instruments 372139B-01 - page 117

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-91 Autom otive Diagnostic Command Set User Manual UDS ReadDataByIdentifier .vi Purpose Executes the UDS ReadDataByIdentif ier servic e. Reads a data record from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from ...

  • National Instruments 372139B-01 - page 118

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-92 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out retu rns the data record from the ECU. If yo u know the record data description, you can use Convert to Phys.vi to interpret th ...

  • National Instruments 372139B-01 - page 119

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-93 Autom otive Diagnostic Command Set User Manual UDS ReadMemor yByAddress.vi Purpose Executes the UDS ReadMemoryBy Address serv ice. Reads data from the ECU memory . Format Input diag ref in specifies the diagnostic session handle, obtained from Ope ...

  • National Instruments 372139B-01 - page 120

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-94 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out returns the ECU memory data. success? indicates successful receipt of a positi ve response message for this diagnostic service. ...

  • National Instruments 372139B-01 - page 121

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-95 Autom otive Diagnostic Command Set User Manual UDS ReportDTCBySeverityMaskRecord.vi Purpose Executes the ReportDTCBySe verityMaskRecord subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Tr ouble Codes ( ...

  • National Instruments 372139B-01 - page 122

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-96 ni.com severity mask def ines the status of DTCs to be read. The v alues are application specific. status def ines the status of DTCs to be read. The values are application specific. error in is a cluster that describes error conditions ...

  • National Instruments 372139B-01 - page 123

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-97 Autom otive Diagnostic Command Set User Manual 6 testNotCompletedThisMonitor ingCycle 7 warningIndicatorRequested Add Data contains optional addit ional data for this DTC. success? indicates successful receipt of a positi ve response message for t ...

  • National Instruments 372139B-01 - page 124

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Comma nd Set User Manual 5-98 ni.com UDS ReportDTCByStatusMask.vi Purpose Executes the ReportDTCByStatusMask subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic T rouble Codes (DTCs). Format Input DTC descriptor is a cluster ...

  • National Instruments 372139B-01 - page 125

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-99 Autom otive Diagnostic Command Set User Manual error in is a cluster that describes error conditions occur ring before the VI ex ecutes. If an error has already occu rred, th e VI returns the value of the error in cluster to error out . status i s ...

  • National Instruments 372139B-01 - page 126

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-100 ni.com success? indicates successful receipt of a positi ve 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 informat ...

  • National Instruments 372139B-01 - page 127

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-101 Automotive Diagnostic Command Set User Manual UDS ReportSeverityIn formationOfDTC.vi Purpose Executes the ReportSe v erityInformat ionOfDTC subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Tr ouble Co ...

  • National Instruments 372139B-01 - page 128

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-102 ni.com DTC mask record defines the status of DTCs to be read. The v alues are application specific. error in is a cluster that describes error conditions occurrin g before the VI ex ecutes. If an error has already occu rred , the VI retu ...

  • National Instruments 372139B-01 - page 129

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-103 Automotive Diagnostic Command Set User Manual Add Data contains optional addit ional data for this DTC. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. If th ...

  • National Instruments 372139B-01 - page 130

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-104 ni.com UDS ReportSupportedDTCs.vi Purpose Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTroubleCodeInformatio n service. Reads all supported Diagnostic T rouble Codes (DTCs). Format Input DTC descriptor is a clust ...

  • National Instruments 372139B-01 - page 131

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-105 Automotive Diagnostic Command Set User Manual error in is a cluster that describes error conditions occur ring before the VI ex ecutes. If an error has already occu rred, th e VI returns the value of the error in cluster to error out . status i s ...

  • National Instruments 372139B-01 - page 132

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-106 ni.com success? indicates successful receipt of a positi ve 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 informat ...

  • National Instruments 372139B-01 - page 133

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-107 Automotive Diagnostic Command Set User Manual UDS RequestSeed.vi Purpose Executes the UDS Security Access service to retriev e a seed from the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi ...

  • National Instruments 372139B-01 - page 134

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-108 ni.com success? indicates successful receipt of a positi ve 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 informat ...

  • National Instruments 372139B-01 - page 135

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-109 Automotive Diagnostic Command Set User Manual UDS RoutineControl.vi Purpose Executes the UDS RoutineControl serv ice. Ex ecutes a routine on the ECU. Format Input mode defines the service operation mode. Y ou can obtain the values from a ring con ...

  • National Instruments 372139B-01 - page 136

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-110 ni.com code is the error code number identi fying an error . A value of 0 means success. A negati v e v alue means error: the VI did not ex ecute the intended operation. A positiv e value means warning: the VI executed intended operation ...

  • National Instruments 372139B-01 - page 137

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-111 Automotive Diagnostic Command Set User Manual UDS SendKey .vi Purpose Executes the Security Access service to send a ke y to the ECU. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic.vi and wired thr ...

  • National Instruments 372139B-01 - page 138

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-112 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. ...

  • National Instruments 372139B-01 - page 139

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-113 Automotive Diagnostic Command Set User Manual UDS T esterPresent.vi Purpose Executes the UDS T esterPresent service. Keeps the ECU in diagnostic mode. Format Input diag ref in specifies the diagnostic session handle, obtained from Open Diagnostic ...

  • National Instruments 372139B-01 - page 140

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-114 ni.com 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 TR UE if an error occurr ...

  • National Instruments 372139B-01 - page 141

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-115 Automotive Diagnostic Command Set User Manual UDS WriteDataByIdentifier .vi Purpose Executes the UDS WriteDataByIdentif ier serv ice. Writes a data record to the ECU. Format Input data in defines the data record to be written to the ECU. If you k ...

  • National Instruments 372139B-01 - page 142

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-116 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. ...

  • National Instruments 372139B-01 - page 143

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-117 Automotive Diagnostic Command Set User Manual UDS WriteMemoryByAddress.vi Purpose Executes the UDS WriteMemoryBy Address serv i ce. Writes data to the ECU memory . Format Input data in defines the memory block to b e written to th e ECU. diag ref ...

  • National Instruments 372139B-01 - page 144

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-118 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. ...

  • National Instruments 372139B-01 - page 145

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-119 Automotive Diagnostic Command Set User Manual OBD (On-Board Diagnostics) Ser vices OBD Clear Emission Related Diagnostic Information.vi Purpose Executes the OBD Clear Emission Related Diagnostic Informatio n service. Clears emission-related Diagn ...

  • National Instruments 372139B-01 - page 146

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-120 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. ...

  • National Instruments 372139B-01 - page 147

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-121 Automotive Diagnostic Command Set User Manual OBD Request Control Of On-Board Device.vi Purpose Executes the OBD Request Control Of On-Boa rd Device service. Modifies ECU I/O port behavior . Format Input data in defi nes application-specific data ...

  • National Instruments 372139B-01 - page 148

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-122 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out returns application-specifi c data for this service. success? indicates successful receipt of a positi ve response message for ...

  • National Instruments 372139B-01 - page 149

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-123 Automotive Diagnostic Command Set User Manual OBD Request Current Powert rain Diagnostic Data.vi Purpose Executes the OBD Request Current Po wertrain Diagnostic Data se rvice. Reads a data record from the ECU . Format Input diag ref in specifies ...

  • National Instruments 372139B-01 - page 150

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-124 ni.com Output diag ref out is a copy of diag ref in . Y ou 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 interpr et this recor ...

  • National Instruments 372139B-01 - page 151

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-125 Automotive Diagnostic Command Set User Manual OBD Request Emission Related DTCs.vi Purpose Executes the OBD Request Emission Related DT Cs service. Reads al l emission-related Diagnostic Trouble Codes (DTCs). Format Input DTC descriptor is a clus ...

  • National Instruments 372139B-01 - page 152

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-126 ni.com status i s T RU E i f a n e r r o r occurred. This VI is not ex ecuted when status is TR UE. code is the error code number identi fying an error . A value of 0 means success. A negati v e v alue means error: the VI did not ex ecut ...

  • National Instruments 372139B-01 - page 153

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-127 Automotive Diagnostic Command Set User Manual success? indicates successful receipt of a positi ve response message for this diagnostic service. error out describes error conditions. If the error in cluster indicated an error , the error out clus ...

  • National Instruments 372139B-01 - page 154

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-128 ni.com OBD Request Emission Related DTCs During Current Drive Cycle.vi Purpose Executes the OBD Request Emission Related DT Cs During Current Dri ve Cycle service. Reads the emission-related Diagnostic T roubl e Codes (DTCs) that occurre ...

  • National Instruments 372139B-01 - page 155

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-129 Automotive Diagnostic Command Set User Manual error in is a cluster that describes error conditions occur ring before the VI ex ecutes. If an error has already occu rred, th e VI returns the value of the error in cluster to error out . status i s ...

  • National Instruments 372139B-01 - page 156

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-130 ni.com For OBD, this field usually does n ot contain valid information. Add Data contains optional additional data for this DTC. Usually , this does not contain valid information (refer to D TC descriptor ). success? indicates successful ...

  • National Instruments 372139B-01 - page 157

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-131 Automotive Diagnostic Command Set User Manual OBD Request On-Board Mon itoring T est Results.vi Purpose Executes the OBD Request On-Board Monitorin g T est Results service. Reads a test data record from the ECU. Format Input diag ref in specifies ...

  • National Instruments 372139B-01 - page 158

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-132 ni.com Output diag ref out is a copy of diag ref in . Y ou 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 interpr et this recor ...

  • National Instruments 372139B-01 - page 159

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-133 Automotive Diagnostic Command Set User Manual OBD Request Powertrain Freeze Frame Data.vi Purpose Executes the OBD Request Po wert rain Freeze Frame Data service. Reads an ECU data record stored while a Diagnostic T rouble Code occurred. Format I ...

  • National Instruments 372139B-01 - page 160

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-134 ni.com Output diag ref out is a copy of diag ref in . Y ou 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 interpr et this recor ...

  • National Instruments 372139B-01 - page 161

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-135 Automotive Diagnostic Command Set User Manual OBD Request Supported PIDs.vi Purpose Executes the OBD Request Current Powertrain Diagno stic Data service to r etriev e the valid PID values for this service. Format Input diag ref in specifies the d ...

  • National Instruments 372139B-01 - page 162

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-136 ni.com 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 TR UE if an error occurr ...

  • National Instruments 372139B-01 - page 163

    Chapter 5 Automotive Di agnostic Command Set API for LabVIE W © National Instruments Corporation 5-137 Automotive Diagnostic Command Set User Manual OBD Request Ve hicle Information.vi Purpose Executes the OBD Request V ehicle Information se rvice. Reads a set of infor mation data from the ECU. Format Input diag ref in specifies the diagnostic ses ...

  • National Instruments 372139B-01 - page 164

    Chapter 5 Automotive Diagnosti c Command Set API for LabVIEW Automotive Diagnostic Command Set User Manual 5-138 ni.com Output diag ref out is a copy of diag ref in . Y ou can wire it to subsequent diagnostic VIs. data out returns the vehicle information from the ECU. Y ou can obtain the description from t he SAE J1979 standard. success? indicates ...

  • National Instruments 372139B-01 - page 165

    © National Instruments Corpor ation 6-1 Automotive Diagnost ic Command Set User Manual 6 Automotive Diagnostic Command Set API for C This chapter lists the A utomotive Diagnostic Command Set API f unctions and describes t heir format, purpose, and parameters. Unless othe rwise stated, each Automotive Diagnostic Command Set function suspends ex ecu ...

  • National Instruments 372139B-01 - page 166

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-2 ni.com List of Data T ypes The following data types are used wit h the Automotive Diagnostic Command Set API f or C functions. Table 6-1. Data T ypes for the Automotive Diagnostic Co mmand Set for C Data T ype Purpose i8 8-bit signed integer i1 ...

  • National Instruments 372139B-01 - page 167

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corpor ation 6-3 Automotive Diagnost ic Command Set User Manual List of Functions The follo wing table contains an alphabetical list of the Automoti v e Diagnostic Command Set API functions. Table 6-2. Functions for the Automotive Diagnostic Command Set for C Function Pu ...

  • National Instruments 372139B-01 - page 168

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-4 ni.com ndDisableNormalMessageTransmission Ex ecutes the DisableNormalMessage T ransmission service. The ECU no longer transmit s its regular communication messages (usually CAN messages). ndDTCToString Returns a string representation (such as P ...

  • National Instruments 372139B-01 - page 169

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corpor ation 6-5 Automotive Diagnost ic Command Set User Manual ndOBDOpen Opens a diagnostic session on a CAN port for OBD-II. ndOBDRequestControlOfOnBoardDevice Ex ecutes the OBD Request Control Of On-Board Device service. Modifies ECU I/O port behavior . ndOBDRequestCu ...

  • National Instruments 372139B-01 - page 170

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-6 ni.com ndOBDRequestPowertrainFreezeFrameData Ex ecutes the OBD Request Powertrain Freeze Frame Data service. Reads an ECU data record stored while a diagnostic trouble code occurred. ndOBDRequestVehicleInformation Ex ecutes the OBD Request V eh ...

  • National Instruments 372139B-01 - page 171

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corpor ation 6-7 Automotive Diagnost ic Command Set User Manual ndReadStatusOfDTC Ex ecutes the ReadStatusOfDiagnostic T roubleCodes service. Reads selected Diagnostic T rouble Codes (DTCs). ndRequestRoutineResultsByLocalIdentifie r Executes the RequestRoutineResultsBy L ...

  • National Instruments 372139B-01 - page 172

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-8 ni.com ndStopRoutineByLocalIdentifier Ex ecutes the StopRoutineByLo cal Identifier service. Stops a routine on the ECU. ndTesterPresent Ex ecutes the T esterPresent service. K eeps the ECU in diagnostic mode. ndUDSClearDiagnosticInformation Ex ...

  • National Instruments 372139B-01 - page 173

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corpor ation 6-9 Automotive Diagnost ic Command Set User Manual ndUDSInputOutputControlByIdentifier Ex ecutes the UDS InputOutputContro lBy Identifier service. Modifies ECU I/O port behavior . ndUDSReadDataByIdentifier Ex ecutes the UDS ReadDataByIdentifier service. Read ...

  • National Instruments 372139B-01 - page 174

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-10 ni.com ndUDSReportSeverityInformationOfDTC Ex ecutes the ReportSeverity InformationOfDTC subfunction of the UDS ReadDiagnosticT rouble CodeInformation ser vice. Reads selected Diagnostic T rouble Codes (DTC s) are read. ndUDSReportSupportedDTC ...

  • National Instruments 372139B-01 - page 175

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-11 Autom otive Diagnostic Command Set User Manual ndUDSWriteMemoryByAddress Ex ecutes the UDS WriteMemoryBy Address service. Writes data to the ECU memory . ndVWTPConnect Establishes a connection channel to an ECU using the VW TP 2.0. ndVWTPConnectionTest M ...

  • National Instruments 372139B-01 - page 176

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-12 ni.com General Functions ndCloseDiagnostic Purpose Closes a diagnostic session. Format long ndCloseDiagnostic( TD1 *diagRefIn); Input diagRefIn Specifies the diagnostic session handle, obtained from ndOpenDiagnostic and passed to subsequent di ...

  • National Instruments 372139B-01 - page 177

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-13 Autom otive Diagnostic Command Set User Manual ndConvertFromPhys Purpose Con verts a physical data value into a binary representation using a type descriptor . Format void ndConvertFromPhys( TD2 *typeDescriptor, double value, unsigned char dataOut[], lon ...

  • National Instruments 372139B-01 - page 178

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-14 ni.com Output dataOut Points to the byte array to be filled with the binar y representation of value . len On input, len must contain the dataOut array length. On retu rn, it contains the number of v alid data bytes in the dataOut array . Desc ...

  • National Instruments 372139B-01 - page 179

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-15 Autom otive Diagnostic Command Set User Manual ndConvertT oPhys Purpose Con verts a binary representation of a v alue into its physical value using a type descript or . Format void ndConvertToPhys( TD2 *typeDescriptor, unsigned char dataIn[], long len, d ...

  • National Instruments 372139B-01 - page 180

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-16 ni.com dataIn Points to the byte array that contains the binary representation of value . len Must contain the dataIn array length. Output value The physical v alue con verted fr om the binary representation. Description Data output from diagn ...

  • National Instruments 372139B-01 - page 181

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-17 Autom otive Diagnostic Command Set User Manual ndCreateExtendedCANIds Purpose Creates diagnostic CAN identifiers according to ISO 15765 -2. Format void ndCreateExtendedCANIds ( unsigned short addressingMode, unsigned short transportProtocol, unsigned cha ...

  • National Instruments 372139B-01 - page 182

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-18 ni.com 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 th e ECU to the host. Description ISO ...

  • National Instruments 372139B-01 - page 183

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-19 Autom otive Diagnostic Command Set User Manual ndDiagnosticSer vice Purpose Executes a generic diagnostic service. If a sp ecial service is not a v ailable through the KWP2000, UDS, or OBD service functions, you can build it using this function. Format l ...

  • National Instruments 372139B-01 - page 184

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-20 ni.com Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the function did not perform the expect ...

  • National Instruments 372139B-01 - page 185

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-21 Autom otive Diagnostic Command Set User Manual ndDTCT oString Purpose Returns a string representation (such as P1234 ) for a 2-byte diagnostic trouble code (DTC). Format void ndDTCToString( unsigned long DTCNum, char DTCString[], long *len); Input DTCNum ...

  • National Instruments 372139B-01 - page 186

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-22 ni.com ndGetProperty Purpose Gets a diagnostic global internal parameter . Format void ndGetProperty( unsigned short propertyID, unsigned long *propertyValue); Input propertyID Define s the parameter whose v alue is to be retrie ved: 0 Timeout ...

  • National Instruments 372139B-01 - page 187

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-23 Autom otive Diagnostic Command Set User Manual 8 Fill CAN Frames returns whether a CAN frame is transmit ted with 8 bytes or less. 0: Short CAN frames are sent with DLC < 8 (default). 1: Short CAN frames are f illed to 8 b ytes wit h Fill Byte (necess ...

  • National Instruments 372139B-01 - page 188

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-24 ni.com ndOBDOpen Purpose Opens a diagnostic session on a CAN port for OBD-II. Format long ndOBDOpen ( char CANInterface[], unsigned long baudrate, unsigned long transmitID, unsigned long receiveID, TD1 *diagRefOut); Input CANInterface Specifie ...

  • National Instruments 372139B-01 - page 189

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-25 Autom otive Diagnostic Command Set User Manual Description ndOBDOpen opens a diagnostic communication ch annel 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 diagRef ...

  • National Instruments 372139B-01 - page 190

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-26 ni.com ndOpenDiagnostic Purpose Opens a diagnostic session on a CAN port . Communication to the ECU is not yet started. Format long ndOpenDiagnostic( char CANInterface[], unsigned long baudrate, unsigned short transportProtocol, unsigned long ...

  • National Instruments 372139B-01 - page 191

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-27 Autom otive Diagnostic Command Set User Manual Output diagRefOut A struct co ntaining all n ecessary informatio n about the d iagnostic session. This is p assed as a handle to all subsequent diagnostic functions, and you must close it using ndCloseDiagno ...

  • National Instruments 372139B-01 - page 192

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-28 ni.com ndSetProperty Purpose Sets a diagnostic global internal parameter . Format void ndSetProperty( unsigned short propertyID, unsigned long propertyValue); Input propertyID Define s the parameter whose v alue is to be mo difi ed: 0 Timeout ...

  • National Instruments 372139B-01 - page 193

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-29 Autom otive Diagnostic Command Set User Manual 8 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 f illed to 8 b ytes wit h Fill Byte (neces ...

  • National Instruments 372139B-01 - page 194

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-30 ni.com ndStatusT oString Purpose Returns a description for an error code. Format void ndStatusToString( long errorCode, char message[], long *len); Input errorCode The status code (return v alue) of any other diagnostic functions. Output messa ...

  • National Instruments 372139B-01 - page 195

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-31 Autom otive Diagnostic Command Set User Manual Status Code Use The application code should check the status return ed from e very Automotiv e Diagnostic Command Set function. If an er ror is detected, close all Auto m otiv e Diagnostic Command Set handle ...

  • National Instruments 372139B-01 - page 196

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-32 ni.com ndVWTPConnect Purpose Establishes a connect ion 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 hand ...

  • National Instruments 372139B-01 - page 197

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-33 Autom otive Diagnostic Command Set User Manual 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 communicatio n channel to an ECU that you can use in s ...

  • National Instruments 372139B-01 - page 198

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-34 ni.com ndVWTPConnectionT est 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 passe ...

  • National Instruments 372139B-01 - page 199

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-35 Autom otive Diagnostic Command Set User Manual ndVWTPDisconnect Purpose T erminates a conn ection channel to an ECU using the VW TP 2.0. Format long ndVWTPDisconnect( TD1 *diagRef); Input diagRef Specifies the diagnostic session handle, ob tained from nd ...

  • National Instruments 372139B-01 - page 200

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-36 ni.com KWP2000 Ser vices ndClearDiagnosticInformation Purpose Executes the ClearDiagnosticInformation service. Clears select ed Diagnostic Trouble Codes (DTCs). Format long ndClearDiagnosticInformation( TD1 *diagRef, unsigned short groupOfDTC, ...

  • National Instruments 372139B-01 - page 201

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-37 Autom otive Diagnostic Command Set User Manual Description This function clears the diagnost ic information on th e ECU memory . groupOfDTC specifies the type of diagnostic trouble cod es to be cleared on the ECU memory . For further details about this s ...

  • National Instruments 372139B-01 - page 202

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-38 ni.com ndControlDTCSetting Purpose Executes the ControlDTCSetting service. Modifi es the generation behavior of selected Diagnostic Trouble Codes (DTCs). Format long ndControlDTCSetting( TD1 *diagRef, unsigned short groupOfDTC, unsigned char d ...

  • National Instruments 372139B-01 - page 203

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-39 Autom otive Diagnostic Command Set User Manual Output success Indicates successful receipt of a positi ve re sponse mes sage for this diagnostic service. Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero ...

  • National Instruments 372139B-01 - page 204

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-40 ni.com ndDisableNormalMessageT ransmission Purpose Executes the Dis ableNormalMessageT ransmission service. The ECU no longer transmits its regular communication message s (usually CAN messages). Format long ndDisableNormalMessageTransmiss ion ...

  • National Instruments 372139B-01 - page 205

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-41 Autom otive Diagnostic Command Set User Manual ndECUReset Purpose Executes the ECUReset service. Resets the ECU. Format long ndECUReset( TD1 *diagRef, unsigned char mode, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, ob tain ...

  • National Instruments 372139B-01 - page 206

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-42 ni.com Output success Indicates successful receipt of a positi ve re sponse mes sage for this diagnostic service. Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed ...

  • National Instruments 372139B-01 - page 207

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-43 Autom otive Diagnostic Command Set User Manual ndEnableNormalMessageT ransmission Purpose Executes the EnableNormalMessage T ransmission service. The ECU starts transmitting it s regular communication message s (usually CAN messages). Format long ndEnabl ...

  • National Instruments 372139B-01 - page 208

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-44 ni.com ndInputOutputContro lByLocalIdentifier Purpose Executes the InputOutputControlByLocalIden tif ier service. Modifies the ECU I/O port behavior . Format long ndInputOutputControlByLocalIden tifier( TD1 *diagRef, unsigned char localID, uns ...

  • National Instruments 372139B-01 - page 209

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-45 Autom otive Diagnostic Command Set User Manual 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 v alid data bytes in the dataOut array . suc ...

  • National Instruments 372139B-01 - page 210

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-46 ni.com ndReadDataByLocalIdentifier Purpose Executes the ReadDataByLocalIdentif ier service. Reads an ECU data record. Format long ndReadDataByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigned char dataOut[], long *len, LVBoolean * ...

  • National Instruments 372139B-01 - page 211

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-47 Autom otive Diagnostic Command Set User Manual Description This function requests data record v alues from the ECU identified by the localID parameter . For further details about this service, refer to the ISO 14230-3 standard. ...

  • National Instruments 372139B-01 - page 212

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-48 ni.com ndReadDTCByStatus Purpose Executes the ReadDiagnosticT roubleCodesByStatus service. Reads selected Diagnostic T rouble Codes (DTCs). Format long ndReadDTCByStatus( TD1 *diagRef, unsigned char mode, unsigned short groupOfDTC, TD3 *DTCDes ...

  • National Instruments 372139B-01 - page 213

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-49 Autom otive Diagnostic Command Set User Manual DTCDescriptor A struct that describes the DTC records the ECU deli vers: typedef struct { long DTCByteLength; long StatusByteLength; long AddDataByteLength; unsigned short ByteOrder; } TD3; DTCByteLength ind ...

  • National Instruments 372139B-01 - page 214

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-50 ni.com 6 testNotCompletedThisMonitori ngCycle 7 warningIndicatorRequested AddData contains optional additional data for this DTC. Usually , this does no t contain valid information (refer to DTCDescriptor ). len On input, len must contain the ...

  • National Instruments 372139B-01 - page 215

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-51 Autom otive Diagnostic Command Set User Manual ndReadECUIdentification Purpose Executes the ReadECUIdentification servi ce. Returns ECU identif ication data. Format long ndReadECUIdentification( TD1 *diagRef, unsigned char mode, unsigned char dataOut[], ...

  • National Instruments 372139B-01 - page 216

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-52 ni.com Description This function requests id entification data from the ECU. mode identif ies the type of identification data requested. The ECU returns identi fication data that dataOut can access. The dataOut format and definition are v e hi ...

  • National Instruments 372139B-01 - page 217

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-53 Autom otive Diagnostic Command Set User Manual ndReadMemor yByAddress Purpose Executes the ReadMemoryBy Address servi ce. Reads data from the ECU memory . Format long ndReadMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char size, unsigne ...

  • National Instruments 372139B-01 - page 218

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-54 ni.com Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the function did not perform the expect ...

  • National Instruments 372139B-01 - page 219

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-55 Autom otive Diagnostic Command Set User Manual ndReadStatusOfDTC Purpose Executes the ReadStatusOfDiagnosticT roubleCo des service. Reads selected Diagnostic T rouble Codes (DTCs). Format long ndReadStatusOfDTC( TD1 *diagRef, unsigned short groupOfDTC, T ...

  • National Instruments 372139B-01 - page 220

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-56 ni.com StatusByteLength indicates the number of b ytes the ECU sends for each DTC’ s status. The def ault i s 1. AddDataByteLength indicates the number of b yte s the ECU sends for each DTC’ s additional data. Usually , there are no additi ...

  • National Instruments 372139B-01 - page 221

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-57 Autom otive Diagnostic Command Set User Manual 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 positi ve re sponse mes sag ...

  • National Instruments 372139B-01 - page 222

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-58 ni.com ndRequestRoutineRes ultsByLocalIdentifier Purpose Executes the RequestRoutineResultsByLocalIdenti f ier service. Returns results from an ECU routine. Format long ndRequestRoutineResultsByLocalI dentifier( TD1 *diagRef, unsigned char loc ...

  • National Instruments 372139B-01 - page 223

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-59 Autom otive Diagnostic Command Set User Manual Description This function request s results (for example, exit status information) referenced by localID and generated by the routine e xecuted in the ECU memory . For further details about this service, ref ...

  • National Instruments 372139B-01 - page 224

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-60 ni.com ndRequestSeed Purpose Executes the Security Access service to retrie ve a seed from the ECU. Format long ndRequestSeed( TD1 *diagRef, unsigned char accessMode, unsigned char seedOut[], long *len, LVBoolean *success); Input diagRef Speci ...

  • National Instruments 372139B-01 - page 225

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-61 Autom otive Diagnostic Command Set User Manual 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 ke y for the ECU ...

  • National Instruments 372139B-01 - page 226

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-62 ni.com ndSendKey Purpose Executes the Security Access service to send a ke y to the ECU. Format long ndSendKey( TD1 *diagRef, unsigned char accessMode, unsigned char keyIn[], long len, LVBoolean *success); Input diagRef Specifies the diagnosti ...

  • National Instruments 372139B-01 - page 227

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-63 Autom otive Diagnostic Command Set User Manual 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 ke y for the ECU ...

  • National Instruments 372139B-01 - page 228

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-64 ni.com ndStartDiagnosticSession Purpose Executes the StartDiagnosticSession service. The ECU is set up in a specific diagnostic mode. Format long ndStartDiagnosticSession( TD1 *diagRef, unsigned char mode, LVBoolean *success); Input diagRef Sp ...

  • National Instruments 372139B-01 - page 229

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-65 Autom otive Diagnostic Command Set User Manual Description This function enables different ECU diagnosti c modes. The possible diagnosti c modes are not defined in ISO 14230 and are application specific. A diagnostic session starts onl y if communication ...

  • National Instruments 372139B-01 - page 230

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-66 ni.com ndStartRoutineB yLocalIdentifier Purpose Executes the StartRoutineByLo calIdentif ier service. Execu tes a routine on the ECU. Format long ndStartRoutineByLocalIdentifier ( TD1 *diagRef, unsigned char localID, unsigned char dataIn[], lo ...

  • National Instruments 372139B-01 - page 231

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-67 Autom otive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 232

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-68 ni.com ndStopDiagnosticSession Purpose Executes the StopDiagnosticSession service. Returns the ECU to normal mode. Format long ndStopDiagnosticSession( TD1 *diagRef, LVBoolean *success); Input diagRef Specifies the diagnostic session handle, o ...

  • National Instruments 372139B-01 - page 233

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-69 Autom otive Diagnostic Command Set User Manual ndStopRoutineByLocalIdentifier Purpose Executes the StopRoutineByLocalIdentif ier service. Stops a routine on the ECU. Format long ndStopRoutineByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigne ...

  • National Instruments 372139B-01 - page 234

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-70 ni.com Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the function did not perform the expect ...

  • National Instruments 372139B-01 - page 235

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-71 Autom otive Diagnostic Command Set User Manual ndT esterPresent Purpose Executes the T esterPresent service. Keeps the ECU in diagnostic mode. Format long ndTesterPresent( TD1 *diagRef, LVBoolean *requireResponse, LVBoolean *success); Input diagRef Speci ...

  • National Instruments 372139B-01 - page 236

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-72 ni.com The T esterPresent service is this “keep aliv e” signal. It does not af fect any other ECU operation. Keep calling ndT esterPresent within the ECU timeout period if no other ser vice is ex ecuted. ...

  • National Instruments 372139B-01 - page 237

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-73 Autom otive Diagnostic Command Set User Manual ndWriteDataByLocalIdentifier Purpose Executes the WriteDataByLocalIdentif ier serv ice. Writes a data record to the ECU. Format long ndWriteDataByLocalIdentifier( TD1 *diagRef, unsigned char localID, unsigne ...

  • National Instruments 372139B-01 - page 238

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-74 ni.com Description This function performs the WriteDataByLocal Identif ier service and writes RecordV alues (data values) to the ECU. dataIn identifies the data v alues to be transmitted. The vehicle manufacturer must ensure the ECU conditions ...

  • National Instruments 372139B-01 - page 239

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-75 Autom otive Diagnostic Command Set User Manual ndWriteMemoryByAddress Purpose Executes the WriteMemoryBy Address servi ce. Writes data to the ECU memory . Format long ndWriteMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char size, unsign ...

  • National Instruments 372139B-01 - page 240

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-76 ni.com did not perform the expected behavior . A po sitiv e v alue 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 ...

  • National Instruments 372139B-01 - page 241

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-77 Autom otive Diagnostic Command Set User Manual UDS (DiagOnCAN) Ser vices ndUDSClearDiagnosticInformation Purpose Executes the UDS ClearDiagnostic Information service. Clears selected Diagnostic T rouble Codes (DTCs). Format long ndUDSClearDiagnosticInfor ...

  • National Instruments 372139B-01 - page 242

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-78 ni.com Description This function clears the diagnostic inform ation on the ECU memory . Depending on th e value of groupOfDTC , the ECU is requested to clear the corresponding DTCs. The groupOfDTC v alues are application specific. For further ...

  • National Instruments 372139B-01 - page 243

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-79 Autom otive Diagnostic Command Set User Manual ndUDSCommunicationControl Purpose Executes the UDS CommunicationC ontrol service. Switches tran smission and/or reception of the normal communicatio n messages (usually CAN messages) on or off. Format long n ...

  • National Instruments 372139B-01 - page 244

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-80 ni.com did not perform the expected behavior . A po sitiv e v alue 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 ...

  • National Instruments 372139B-01 - page 245

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-81 Autom otive Diagnostic Command Set User Manual ndUDSControlDTCSetting Purpose Executes the UDS ControlDTCSett ing service. Modifies Diagnostic Tr ouble Code (DTC) behavior . Format long ndUDSControlDTCSetting( TD1 *diagRef, unsigned char type, unsigned c ...

  • National Instruments 372139B-01 - page 246

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-82 ni.com ndUDSDiagnosticSessionControl Purpose Executes the UDS DiagnosticSessionControl se rvice. The EC U is set up in a specific diagnostic mode. Format long ndUDSDiagnosticSessionControl( TD1 *diagRef, unsigned char mode, LVBoolean *success) ...

  • National Instruments 372139B-01 - page 247

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-83 Autom otive Diagnostic Command Set User Manual ndUDSECUReset Purpose Executes the UDS ECUReset service. Resets the ECU. Format long ndUDSECUReset( TD1 *diagRef, unsigned char mode, LVBoolean *success); Input diagRef Specifies the diagnostic session handl ...

  • National Instruments 372139B-01 - page 248

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-84 ni.com Description This function re quests the ECU to perform an ECU reset effecti vely based on the mode parameter v alue content. The vehicle manufact urer determines when the positi ve response message is sent. Depending the value of mode , ...

  • National Instruments 372139B-01 - page 249

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-85 Autom otive Diagnostic Command Set User Manual ndUDSInputOutputControlByIdentifier Purpose Executes the UDS InputOutputControlByIdentifier service. Modifies ECU I/O port behavior . Format long ndUDSInputOutputControlByIdenti fier( TD1 *diagRef, unsigned ...

  • National Instruments 372139B-01 - page 250

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-86 ni.com Output dataOut Returns application-specific data for this service. len2 On input, len2 must contain the dataOut array lengt h. On return, it contains the nu mber of v alid data bytes in the dataOut array . success Indicates successful r ...

  • National Instruments 372139B-01 - page 251

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-87 Autom otive Diagnostic Command Set User Manual ndUDSReadDataByIdentifier Purpose Executes the UDS ReadDataBy Identif ier service. Reads an ECU data record. Format long ndUDSReadDataByIdentifier( TD1 *diagRef, unsigned short ID, unsigned char dataOut[], l ...

  • National Instruments 372139B-01 - page 252

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-88 ni.com Description This function requests data record v alues from the ECU identified by the ID parameter . For further details about this service, refer to the ISO 15765-3 standard. ...

  • National Instruments 372139B-01 - page 253

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-89 Autom otive Diagnostic Command Set User Manual ndUDSReadMemor yByAddress Purpose Executes the UDS ReadMemoryBy Address serv ice. Reads data from the ECU memory . Format long ndUDSReadMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char siz ...

  • National Instruments 372139B-01 - page 254

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-90 ni.com Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the function did not perform the expect ...

  • National Instruments 372139B-01 - page 255

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-91 Autom otive Diagnostic Command Set User Manual ndUDSReportDTCBySeverityMaskRecord Purpose Executes the ReportDTCBySe verityMaskRecord subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Tr ouble Codes (DTCs). Fo ...

  • National Instruments 372139B-01 - page 256

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-92 ni.com AddDataByteLength indicates the number of b yte s the ECU sends for each DTC’ s additional data. For this subfunction, the default is 2. ByteOrder indicates the byte ordering for multib yte items: 0: MSB_FIRST (Motorola), default 1: L ...

  • National Instruments 372139B-01 - page 257

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-93 Autom otive Diagnostic Command Set User Manual 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 positi ve re sponse mes sag ...

  • National Instruments 372139B-01 - page 258

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-94 ni.com ndUDSReportDTCByStatusMask Purpose Executes the ReportDTCByStatusMask subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic T rouble Codes (DTCs). Format long ndUDSReportDTCByStatusMask( TD1 *dia ...

  • National Instruments 372139B-01 - page 259

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-95 Autom otive Diagnostic Command Set User Manual ByteOrder indicates the byte ordering for multib yte items: 0: MSB_FIRST (Motorola), default 1: LSB_FIRST (Intel) This function interprets the response byte stream according to this description and returns t ...

  • National Instruments 372139B-01 - page 260

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-96 ni.com Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the function did not perform the expect ...

  • National Instruments 372139B-01 - page 261

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-97 Autom otive Diagnostic Command Set User Manual ndUDSReportSeverityInformationOfDTC Purpose Executes the ReportSe v erityInformat ionOfDTC subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads selected Diagnostic Tr ouble Codes (DTCs) ...

  • National Instruments 372139B-01 - page 262

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Comma nd Set User Manual 6-98 ni.com ByteOrder indicates the byte ordering for multib yte 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 recor ds in ...

  • National Instruments 372139B-01 - page 263

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-99 Autom otive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 264

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-100 ni.com ndUDSReportSupportedDTCs Purpose Executes the ReportSupportedDTCs subfunction of the UDS ReadDiagnosticTroubleCodeInformation service. Reads all suppo rted Diagnostic Trouble Codes (DTCs). Format long ndUDSReportSupportedDTCs( TD1 *diag ...

  • National Instruments 372139B-01 - page 265

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-101 Automotive Diagnostic Command Set User Manual ByteOrder indicates the byte ordering for multib yte items: 0: MSB_FIRST (Motorola), default 1: LSB_FIRST (Intel) This function interprets the response byte stream according to this description and returns t ...

  • National Instruments 372139B-01 - page 266

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-102 ni.com Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the function did not perform the expect ...

  • National Instruments 372139B-01 - page 267

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-103 Automotive Diagnostic Command Set User Manual ndUDSRequestSeed Purpose Executes the UDS Security Access service to retriev e a seed from the ECU. Format long ndUDSRequestSeed( TD1 *diagRef, unsigned char accessMode, unsigned char seedOut[], long *len, L ...

  • National Instruments 372139B-01 - page 268

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-104 ni.com 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 ke y for the ECU on the host. 3. Send the k ...

  • National Instruments 372139B-01 - page 269

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-105 Automotive Diagnostic Command Set User Manual ndUDSRoutineControl Purpose Executes the UDS RoutineControl serv ice. Ex ecutes a routine on the ECU. Format long ndUDSRoutineControl( TD1 *diagRef, unsigned short ID, unsigned char mode, unsigned char dataI ...

  • National Instruments 372139B-01 - page 270

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-106 ni.com Output dataOut Returns application-specific output parameters from the routine. len2 On input, len2 must contain the dataOut array lengt h. On return, it contains the nu mber of v alid data bytes in the dataOut array . success Indicates ...

  • National Instruments 372139B-01 - page 271

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-107 Automotive Diagnostic Command Set User Manual ndUDSSendKey Purpose Executes the UDS Security Access serv ice to send a key to the ECU. Format long ndUDSSendKey( TD1 *diagRef, unsigned char accessMode, unsigned char keyIn[], long len, LVBoolean *success) ...

  • National Instruments 372139B-01 - page 272

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-108 ni.com 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 ke y for the ECU on the host. 3. Send the k ...

  • National Instruments 372139B-01 - page 273

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-109 Automotive Diagnostic Command Set User Manual ndUDST esterPresent Purpose Executes the UDS T esterPresent service. Keeps the ECU in diagnostic mode. Format long ndUDSTesterPresent( TD1 *diagRef, LVBoolean *requireResponse, LVBoolean *success); Input dia ...

  • National Instruments 372139B-01 - page 274

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-110 ni.com The T esterPresent service is this “keep aliv e” signal. It does not af fect any other ECU operation. Keep calling ndU DSTesterPresent within the ECU tim eout period if no other service is ex ecuted. ...

  • National Instruments 372139B-01 - page 275

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-111 Automotive Diagnostic Command Set User Manual ndUDSWriteDataByIdentifier Purpose Executes the UDS WriteDataByIdentif ier serv ice. Writes a data record to the ECU. Format long ndUDSWriteDataByIdentifier( TD1 *diagRef, unsigned short ID, unsigned char da ...

  • National Instruments 372139B-01 - page 276

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-112 ni.com Description This function performs the UDS service Write DataByIdentifier and writes RecordV alues (data v alues) into the ECU. dataIn identif ies the data. The v ehicle manufacturer must ensure the ECU conditions are met when performin ...

  • National Instruments 372139B-01 - page 277

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-113 Automotive Diagnostic Command Set User Manual ndUDSWriteMemor yByAddress Purpose Executes the UDS WriteMemoryBy Address serv i ce. Writes data to the ECU memory . Format long ndUDSWriteMemoryByAddress( TD1 *diagRef, unsigned long address, unsigned char ...

  • National Instruments 372139B-01 - page 278

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-114 ni.com did not perform the expected behavior . A po sitiv e v alue 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 ...

  • National Instruments 372139B-01 - page 279

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-115 Automotive Diagnostic Command Set User Manual OBD (On-Board Diagnostics) Ser vices ndOBDClearEmissionRelat edDiagnosticInformation Purpose Executes the OBD Clear Emission Related Diagnostic Informatio n service. Clears emission-related diagnostic troubl ...

  • National Instruments 372139B-01 - page 280

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-116 ni.com ndOBDRequestControlOfOnBoardDevice Purpose Executes the OBD Request Control Of On-Boa rd Device service. Modifies ECU I/O port behavior . Format long ndOBDRequestControlOfOnBoardDev ice( TD1 *diagRef, unsigned char TID, unsigned char da ...

  • National Instruments 372139B-01 - page 281

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-117 Automotive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 282

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-118 ni.com ndOBDRequestCurrentPowertrainDiagnosticData Purpose Executes the OBD Request Current Po wertrain Di agnostic Data servic e. Reads an ECU data record. Format long ndOBDRequestCurrentPowertrainDi agnosticData( TD1 *diagRef, unsigned char ...

  • National Instruments 372139B-01 - page 283

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-119 Automotive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 284

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-120 ni.com ndOBDRequestEmissionRelatedDTCs Purpose Executes the OBD Request Emission Related DT Cs service. Reads al l emission-related Diagnostic Trouble Codes (DTCs). Format long ndOBDRequestEmissionRelatedDTCs ( TD1 *diagRef, TD3 *DTCDescriptor ...

  • National Instruments 372139B-01 - page 285

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-121 Automotive Diagnostic Command Set User Manual 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. F or the d ...

  • National Instruments 372139B-01 - page 286

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-122 ni.com ndOBDRequestEmissionRelatedD TCsDuringCurrentDriveCycle Purpose Executes the OBD Request Emission Related DT Cs During Current Dri ve Cycle service. Reads the emission-related Diagnostic T roubl e Codes (DTCs) that occurred during the c ...

  • National Instruments 372139B-01 - page 287

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-123 Automotive Diagnostic Command Set User Manual 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. F or the d ...

  • National Instruments 372139B-01 - page 288

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-124 ni.com ndOBDRequestOnBoardMo nitoringT estResults Purpose Executes the OBD Request On-Board Monitorin g T est Results service. Reads an ECU test data record. Format long ndOBDRequestOnBoardMonitoringTe stResults( TD1 *diagRef, unsigned char OB ...

  • National Instruments 372139B-01 - page 289

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-125 Automotive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 290

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-126 ni.com ndOBDRequestPowertrainFreezeFrameData Purpose Executes the OBD Request Po wert rain Freeze Frame Data service. Reads an ECU data record stored while a diagnostic trouble code occurred. Format long ndOBDRequestPowertrainFreezeFra meData( ...

  • National Instruments 372139B-01 - page 291

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-127 Automotive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 292

    Chapter 6 Automotive Diagnosti c Command Set API for C Automotive Diagnostic Command Set User Manual 6-128 ni.com ndOBDRequestV ehicleInformation Purpose Executes the OBD Request V ehicle Information se rvice. Reads a set of infor mation data from the ECU. Format long ndOBDRequestVehicleInformation( TD1 *diagRef, unsigned char infoType, unsigned ch ...

  • National Instruments 372139B-01 - page 293

    Chapter 6 Automotive Diagnost ic Command Set API for C © National Instruments Corporation 6-129 Automotive Diagnostic Command Set User Manual Return V alue The return value indicates the f unction call status as a signed 32-bit integer . Zero means the function executed successfully . A negati ve v alue specifi es an error , which means the functi ...

  • National Instruments 372139B-01 - page 294

    © National Instruments Corpor ation A-1 Automotive Diagnost ic Command Set User Manual A T echnical Support and Professional Ser vices Visit the following sections of the National Instruments Web site at ni.com for technical support an d professional services: • Support —Online technical support resources at ni.com/support include the followin ...

  • National Instruments 372139B-01 - page 295

    © National Instruments Corpor ation I-1 Automotive Diagnost ic Command Set User Manual Index A application debugging, 3-3 application development, 3-1 Automotiv e Diagnostic Command Set API C, 6-1 LabVIEW, 5-1 API structure, 4-2 application dev elopment, 3-1 av ailable diagnostic services, 4-4 choosing a programm ing language, 3-1 configuration, 2 ...

  • National Instruments 372139B-01 - page 296

    Index Automotive Diagnostic Comma nd Set User Manual I-2 ni.com ndOBDRequestContro lOfOnBoard Device, 6-116 ndOBDRequestCurrentPowertrain DiagnosticData, 6-118 ndOBDRequestEmissionRelat edDTCs, 6-120 ndOBDRequestEmissionRelat edDTCs DuringCurrentDriv eCycle, 6-122 ndOBDRequestOnBoa rdMonitoringT est Results, 6-124 ndOBDRequestPowertrainFreeze Frame ...

  • National Instruments 372139B-01 - page 297

    Index © National Instruments Corpor ation I-3 Automotive Diagnost ic Command Set User Manual diagnostic services KWP2000, 1-2 UDS, 1-5 diagnostic services av ailable, 4-4 diagnostic tools (NI resources), A-1 Diagnostic Trouble Codes KWP2000, 1-4 DisableNormalMessageTransmission.vi, 5-38 documentation con v entions used in manual, xi NI resources, ...

  • National Instruments 372139B-01 - page 298

    Index Automotive Diagnostic Comma nd Set User Manual I-4 ni.com DisableNormalMessageTransmission.vi, 5-38 DTC to String.vi, 5-21 ECUReset.vi, 5-40 EnableNormalMessageT ransmission.vi, 5-42 general functions, 5-8 InputOutputControlBy LocalIdentifier .vi, 5-44 KWP2000 services, 5-32 list of VIs, 5-2 OBD (On-Board Diagnostics) services, 5-119 OBD Clea ...

  • National Instruments 372139B-01 - page 299

    Index © National Instruments Corpor ation I-5 Automotive Diagnost ic Command Set User Manual N National Instruments support and services, A-1 ndClearDiagnosticIn formation, 6-36 ndCloseDiagnostic, 6-12 ndControlDTCSetting, 6-38 ndCon vertFromPh ys, 6-13 ndCon vertT oPhys, 6-15 ndCreateExtendedCANIds, 6-17 ndDiagnosticService, 6-19 ndDisableNormalM ...

  • National Instruments 372139B-01 - page 300

    Index Automotive Diagnostic Comma nd Set User Manual I-6 ni.com OBD Clear Emission Related Diag nostic 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 Dri ve Cycle.vi, 5-128 OBD Request Emission Related ...

  • National Instruments 372139B-01 - page 301

    Index © National Instruments Corpor ation I-7 Automotive Diagnost ic Command Set User Manual UDS ReportDTCBySev eri tyMaskRecord.vi, 5-95 UDS ReportDTCByStatusMask.vi, 5-98 UDS ReportSe verityInformationOfDTC.vi, 5-101 UDS ReportSupportedDTCs.vi, 5-104 UDS RequestSeed.vi, 5-107 UDS RoutineControl.vi, 5-109 UDS SendKe y .vi, 5-111 UDS T esterPresen ...

Manufacturer National Instruments Category Automobile

Documents that we receive from a manufacturer of a National Instruments 372139B-01 can be divided into several groups. They are, among others:
- National Instruments technical drawings
- 372139B-01 manuals
- National Instruments product data sheets
- information booklets
- or energy labels National Instruments 372139B-01
All of them are important, but the most important information from the point of view of use of the device are in the user manual National Instruments 372139B-01.

A group of documents referred to as user manuals is also divided into more specific types, such as: Installation manuals National Instruments 372139B-01, service manual, brief instructions and user manuals National Instruments 372139B-01. Depending on your needs, you should look for the document you need. In our website you can view the most popular manual of the product National Instruments 372139B-01.

A complete manual for the device National Instruments 372139B-01, how should it look like?
A manual, also referred to as a user manual, or simply "instructions" is a technical document designed to assist in the use National Instruments 372139B-01 by users. Manuals are usually written by a technical writer, but in a language understandable to all users of National Instruments 372139B-01.

A complete National Instruments manual, should contain several basic components. Some of them are less important, such as: cover / title page or copyright page. However, the remaining part should provide us with information that is important from the point of view of the user.

1. Preface and tips on how to use the manual National Instruments 372139B-01 - At the beginning of each manual we should find clues about how to use the guidelines. It should include information about the location of the Contents of the National Instruments 372139B-01, FAQ or common problems, i.e. places that are most often searched by users in each manual
2. Contents - index of all tips concerning the National Instruments 372139B-01, that we can find in the current document
3. Tips how to use the basic functions of the device National Instruments 372139B-01 - which should help us in our first steps of using National Instruments 372139B-01
4. Troubleshooting - systematic sequence of activities that will help us diagnose and subsequently solve the most important problems with National Instruments 372139B-01
5. FAQ - Frequently Asked Questions
6. Contact detailsInformation about where to look for contact to the manufacturer/service of National Instruments 372139B-01 in a specific country, if it was not possible to solve the problem on our own.

Do you have a question concerning National Instruments 372139B-01?

Use the form below

If you did not solve your problem by using a manual National Instruments 372139B-01, ask a question using the form below. If a user had a similar problem with National Instruments 372139B-01 it is likely that he will want to share the way to solve it.

Copy the text from the picture

Comments (1)

владимир

нужна инструкция на русском языке