Download automotive Diag CAN NI PDF

Titleautomotive Diag CAN NI
File Size1.2 MB
Total Pages334
Table of Contents
                            Automotive Diagnostic Command Set User Manual
Support
	Worldwide Technical Support and Product Information
	National Instruments Corporate Headquarters
	Worldwide Offices
Important Information
	Warranty
	Copyright
	Trademarks
	Patents
	WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
Compliance
Contents
About This Manual
	Conventions
	Related Documentation
Chapter 1 Introduction
	KWP2000 (Key Word Protocol 2000)
		Transport Protocol
		Diagnostic Services
		Diagnostic Service Format
		Connect/Disconnect
		GetSeed/Unlock
		Read/Write Memory
		Measurements
		Diagnostic Trouble Codes
		Input/Output Control
		Remote Activation of a Routine
		External References
	UDS (Unified Diagnostic Services)
		Diagnostic Services
		Diagnostic Service Format
		External References
	OBD (On-Board Diagnostic)
Chapter 2 Installation and Configuration
	Installation
	LabVIEW Real-Time (RT) Configuration
	Hardware and Software Requirements
Chapter 3 Application Development
	Choosing the Programming Language
		LabVIEW
		LabWindows/CVI
		Visual C++ 6
		Other Programming Languages
	Application Development on CompactRIO or R Series
		Transferring Data between the FPGA and Host Computer
		Customizing the CAN Bridge (FPGA) VI
	Debugging an Application
Chapter 4 Using the Automotive Diagnostic Command Set
	Structure of the Automotive Diagnostic Command Set
	Automotive Diagnostic Command Set API Structure
	General Programming Model
	Available Diagnostic Services
	Tweaking the Transport Protocol
Chapter 5 Automotive Diagnostic Command Set API for LabVIEW
	Section Headings
		Purpose
		Format
		Input and Output
		Description
	List of VIs
		Table 5-1. Automotive Diagnostic Command Set API VIs for LabVIEW
	General Functions
		Close Diagnostic.vi
		Convert from Phys.vi
		Convert to Phys.vi
		Create Extended CAN IDs.vi
		Diag Get Property.vi
		Diag Set Property.vi
		Diagnostic Service.vi
		DTC to String.vi
		OBD Open.vi
		Open Diagnostic.vi
		VWTP Connect.vi
		VWTP Connection Test.vi
		VWTP Disconnect.vi
	KWP2000 Services
		ClearDiagnosticInformation.vi
		ControlDTCSetting.vi
		DisableNormalMessageTransmission.vi
		ECUReset.vi
		EnableNormalMessageTransmission.vi
		InputOutputControlByLocalIdentifier.vi
		ReadDataByLocalIdentifier.vi
		ReadDTCByStatus.vi
		ReadECUIdentification.vi
		ReadMemoryByAddress.vi
		ReadStatusOfDTC.vi
		RequestRoutineResultsByLocalIdentifier.vi
		RequestSeed.vi
		SendKey.vi
		StartDiagnosticSession.vi
		StartRoutineByLocalIdentifier.vi
		StopDiagnosticSession.vi
		StopRoutineByLocalIdentifier.vi
		TesterPresent.vi
		WriteDataByLocalIdentifier.vi
		WriteMemoryByAddress.vi
	UDS (DiagOnCAN) Services
		UDS ClearDiagnosticInformation.vi
		UDS CommunicationControl.vi
		UDS ControlDTCSetting.vi
		UDS DiagnosticSessionControl.vi
		UDS ECUReset.vi
		UDS InputOutputControlByIdentifier.vi
		UDS ReadDataByIdentifier.vi
		UDS ReadMemoryByAddress.vi
		UDS ReportDTCBySeverityMaskRecord.vi
		UDS ReportDTCByStatusMask.vi
		UDS ReportSeverityInformationOfDTC.vi
		UDS ReportSupportedDTCs.vi
		UDS RequestDownload.vi
		UDS RequestSeed.vi
		UDS RequestTransferExit.vi
		UDS RequestUpload.vi
		UDS RoutineControl.vi
		UDS SendKey.vi
		UDS TesterPresent.vi
		UDS TransferData.vi
		UDS WriteDataByIdentifier.vi
		UDS WriteMemoryByAddress.vi
	OBD (On-Board Diagnostics) Services
		OBD Clear Emission Related Diagnostic Information.vi
		OBD Request Control Of On-Board Device.vi
		OBD Request Current Powertrain Diagnostic Data.vi
		OBD Request Emission Related DTCs.vi
		OBD Request Emission Related DTCs During Current Drive Cycle.vi
		OBD Request On-Board Monitoring Test Results.vi
		OBD Request Permanent Fault Codes.vi
		OBD Request Powertrain Freeze Frame Data.vi
		OBD Request Supported PIDs.vi
		OBD Request Vehicle Information.vi
Chapter 6 Automotive Diagnostic Command Set API for C
	Section Headings
		Purpose
		Format
		Input and Output
		Description
	List of Data Types
		Table 6-1. Data Types for the Automotive Diagnostic Command Set for C
	List of Functions
		Table 6-2. Functions for the Automotive Diagnostic Command Set for C
	General Functions
		ndCloseDiagnostic
		ndConvertFromPhys
		ndConvertToPhys
		ndCreateExtendedCANIds
		ndDiagnosticService
		ndDTCToString
		ndGetProperty
		ndOBDOpen
		ndOpenDiagnostic
		ndSetProperty
		ndStatusToString
		ndVWTPConnect
		ndVWTPConnectionTest
		ndVWTPDisconnect
	KWP2000 Services
		ndClearDiagnosticInformation
		ndControlDTCSetting
		ndDisableNormalMessageTransmission
		ndECUReset
		ndEnableNormalMessageTransmission
		ndInputOutputControlByLocalIdentifier
		ndReadDataByLocalIdentifier
		ndReadDTCByStatus
		ndReadECUIdentification
		ndReadMemoryByAddress
		ndReadStatusOfDTC
		ndRequestRoutineResultsByLocalIdentifier
		ndRequestSeed
		ndSendKey
		ndStartDiagnosticSession
		ndStartRoutineByLocalIdentifier
		ndStopDiagnosticSession
		ndStopRoutineByLocalIdentifier
		ndTesterPresent
		ndWriteDataByLocalIdentifier
		ndWriteMemoryByAddress
	UDS (DiagOnCAN) Services
		ndUDSClearDiagnosticInformation
		ndUDSCommunicationControl
		ndUDSControlDTCSetting
		ndUDSDiagnosticSessionControl
		ndUDSECUReset
		ndUDSInputOutputControlByIdentifier
		ndUDSReadDataByIdentifier
		ndUDSReadMemoryByAddress
		ndUDSReportDTCBySeverityMaskRecord
		ndUDSReportDTCByStatusMask
		ndUDSReportSeverityInformationOfDTC
		ndUDSReportSupportedDTCs
		ndUDSRequestDownload
		ndUDSRequestSeed
		ndUDSRequestTransferExit
		ndUDSRequestUpload
		ndUDSRoutineControl
		ndUDSSendKey
		ndUDSTesterPresent
		ndUDSTransferData
		ndUDSWriteDataByIdentifier
		ndUDSWriteMemoryByAddress
	OBD (On-Board Diagnostics) Services
		ndOBDClearEmissionRelatedDiagnosticInformation
		ndOBDRequestControlOfOnBoardDevice
		ndOBDRequestCurrentPowertrainDiagnosticData
		ndOBDRequestEmissionRelatedDTCs
		ndOBDRequestEmissionRelatedDTCsDuringCurrentDriveCycle
		ndOBDRequestOnBoardMonitoringTestResults
		ndOBDRequestPermanentFaultCodes
		ndOBDRequestPowertrainFreezeFrameData
		ndOBDRequestVehicleInformation
Appendix A Technical Support and Professional Services
Index
	A-C
	D
	E-L
	N
	O-T
	U-W
                        
Document Text Contents
Page 1

CAN
Automotive Diagnostic Command Set User Manual

Automotive Diagnostic Command Set User Manual

December 2009
372139D-01

Page 2

Support

Worldwide Technical Support and Product Information

ni.com

National Instruments Corporate Headquarters

11500 North Mopac Expressway Austin, 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, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00,
Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000,
Israel 972 3 6393737, Italy 39 02 41309277, Japan 0120-527196, Korea 82 02 3451 3400,
Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 (0) 348 433 466,
New Zealand 0800 553 322, Norway 47 (0) 66 90 76 60, Poland 48 22 328 90 10, Portugal 351 210 311 210,
Russia 7 495 783 6851, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197,
Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151, Taiwan 886 02 2377 2222,
Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 (0) 1635 523545

For further support information, refer to the Technical Support and Professional Services appendix. To comment
on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter
the info code feedback.

© 2007–2009 National Instruments Corporation. All rights reserved.

Page 167

Chapter 5 Automotive Diagnostic Command Set API for LabVIEW

© National Instruments Corporation 5-137 Automotive Diagnostic Command Set User Manual

OBD Request Current Powertrain Diagnostic Data.vi

Purpose
Executes the OBD Request Current Powertrain Diagnostic Data service. Reads a data record
from the ECU.

Format

Input
diag ref in specifies the diagnostic session handle, obtained from Open
Diagnostic.vi and wired through subsequent diagnostic VIs. Normally, it is
not necessary to manually manipulate the elements of this cluster.

PID defines the parameter identifier of the data to be read. The SAE J1979
standard defines the values.

error in is a cluster that describes error conditions occurring before the VI
executes. If an error has already occurred, the VI returns the value of the
error in cluster to error out.

status is TRUE if an error occurred. This VI is not executed when
status is TRUE.

code is the error code number identifying an error. A value of 0
means success. A negative value means error: the VI did not
execute the intended operation. A positive value means warning:
the VI executed intended operation, but an informational warning
is returned. For a description of the code, wire the error cluster to
a LabVIEW error-handling VI, such as the Simple Error
Handler.

source identifies the VI where the error occurred.

Page 168

Chapter 5 Automotive Diagnostic 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. You can wire it to subsequent
diagnostic VIs.

data out returns the ECU data record. If you know the record data
description, you can use Convert from Phys.vi to interpret this record.
You can obtain the description from the SAE J1979 standard.

success? indicates successful receipt of a positive response message for
this diagnostic service.

error out describes error conditions. If the error in cluster indicated an
error, the error out cluster contains the same information. Otherwise,
error out describes the error status of this VI.

status is TRUE if an error occurred.

code is the error code number identifying an error. A value of 0
means success. A negative value means error: the VI did not
execute the intended operation. A positive value means warning:
the VI executed intended operation, but an informational warning
is returned. For a description of the code, wire the error cluster to
a LabVIEW error-handling VI, such as the Simple Error
Handler.

source identifies the VI where the error occurred.

Page 333

Index

Automotive Diagnostic Command Set User Manual I-6 ni.com

ndUDSTesterPresent, 6-116
ndUDSTransferData, 6-118
ndUDSWriteDataByIdentifier, 6-120
ndUDSWriteMemoryByAddress, 6-122
ndVWTPConnect, 6-33
ndVWTPConnectionTest, 6-35
ndVWTPDisconnect, 6-36
ndWriteDataByLocalIdentifier, 6-74
ndWriteMemoryByAddress, 6-76
NI support and services, A-1

O
OBD, 1-6
OBD (On-Board Diagnostics) services

C API, 6-124
LabVIEW API, 5-133

OBD Clear Emission Related Diagnostic
Information.vi, 5-133

OBD Open.vi, 5-24
OBD Request Control Of On-Board

Device.vi, 5-135
OBD Request Current Powertrain Diagnostic

Data.vi, 5-137
OBD Request Emission Related DTCs During

Current Drive Cycle.vi, 5-142
OBD Request Emission Related DTCs.vi,

5-139
OBD Request On-Board Monitoring Test

Results.vi, 5-145
OBD Request Permanent Fault Codes.vi,

5-147
OBD Request Powertrain Freeze Frame

Data.vi, 5-150
OBD Request Supported PIDs.vi, 5-152
On-Board Diagnostic, 1-6
Open Diagnostic.vi, 5-27
other programming languages, using with

Automotive Diagnostic Command Set, 3-3

P
programming examples (NI resources), A-1
programming language, choosing, 3-1

R
read/write memory, 1-3
ReadDataByLocalIdentifier.vi, 5-51
ReadDTCByStatus.vi, 5-53
ReadECUIdentification.vi, 5-56
ReadMemoryByAddress.vi, 5-58
ReadStatusOfDTC.vi, 5-60
related documentation, xii
remote action of a routine, KWP2000, 1-4
RequestRoutineResultsByLocalIdentifier.vi,

5-63
RequestSeed.vi, 5-65

S
SendKey.vi, 5-67
software

NI resources, A-1
requirements, 2-3

StartDiagnosticSession.vi, 5-69
StartRoutineByLocalIdentifier.vi, 5-71
StopDiagnosticSession.vi, 5-73
StopRoutineByLocalIdentifier.vi, 5-75
support, technical, A-1

T
technical support, A-1
TesterPresent.vi, 5-77
training and certification (NI resources), A-1
transport protocol

KWP2000, 1-2
tweaking, 4-4

troubleshooting (NI resources), A-1
tweaking the transport protocol, 4-4

Page 334

Index

© National Instruments Corporation I-7 Automotive Diagnostic Command Set User Manual

U
UDS, 1-5

diagnostic service format, 1-5
diagnostic services, 1-5
external references, 1-6

UDS (DiagOnCAN) services
C API, 6-78
LabVIEW API, 5-83

UDS ClearDiagnosticInformation.vi, 5-83
UDS CommunicationControl.vi, 5-86
UDS ControlDTCSetting.vi, 5-88
UDS DiagnosticSessionControl.vi, 5-90
UDS ECUReset.vi, 5-92
UDS InputOutputControlByIdentifier.vi, 5-94
UDS ReadDataByIdentifier.vi, 5-96
UDS ReadMemoryByAddress.vi, 5-98
UDS ReportDTCBySeverityMaskRecord.vi,

5-100
UDS ReportDTCByStatusMask.vi, 5-103
UDS ReportSeverityInformationOfDTC.vi,

5-106
UDS ReportSupportedDTCs.vi, 5-109
UDS RequestDownload.vi, 5-112
UDS RequestSeed.vi, 5-114

UDS RequestTransferExit.vi, 5-116
UDS RequestUpload.vi, 5-118
UDS RoutineControl.vi, 5-120
UDS SendKey.vi, 5-122
UDS TesterPresent.vi, 5-124
UDS TransferData.vi, 5-126
UDS WriteDataByIdentifier.vi, 5-129
UDS WriteMemoryByAddress.vi, 5-131
Unified Diagnostic Services, 1-5

V
Visual C++ 6, using with Automotive

Diagnostic Command Set, 3-2
VWTP Connect.vi, 5-31
VWTP Connection Test.vi, 5-33
VWTP Disconnect.vi, 5-35

W
Web resources, A-1
WriteDataByLocalIdentifier.vi, 5-79
WriteMemoryByAddress.vi, 5-81

Similer Documents