实例介绍
UDS_PCAN_APIA应用程序,整车网络诊断应用程序,超值!(PEAK CAN UDS Application Programming Interface User Manual.pdf)
PCAN-UDS APi- User Manual Contents 1 PCAN-UDS API Documentation 2 Introduction 2.1 Understanding PCAN-UDS 2.2 Using PCAN-UDS 2.3 Features 788899 2.4 System Requi rements 2.5 Scope of supply 3 DLL API Reference 3.1 Namespaces 10 3.1.1 Peak Can uds 3.2 Units 3.21 PuDs Unit 3.3 Classes 3.3.1 UDSApi 3.3.2 TUDSApi 3. 4 structures 1 02233455 3.4.1 TPUDSMsg 3.4.2 TPUDSSessionInfo 3.43 TPUDSNetAddrinfo 3.5 Types 21 3.5.1 TPUDSCANHand]e 22 3.5.2 TPUDSstatus 23 3.5.3 TPUDSBaudrate 25 3.5.4 TPUDSHWType 28 3.5.5 TPUDSResult 30 3.5.6 TPUDSParameter 31 3.5.7 TPUDSService 39 3.5.8 TPUDSAddress 42 3.5.9 TPUDSCanId 44 3.5.10 TPUDSProtoco l 46 3.5.11 TPUDSAddressingType 48 3.5.12 TPUDSMessageType 49 3.5.13 TPUDSSVCParamDSC 50 3.5.14 TPUDSSVCParamER 51 3.5.15 TPUDSSVCParamcc 53 3.5.16 TPUDSSVCParamTP 54 3.5.17 TPUDSSVCParamcdTCS 54 3.5.18 TPUDSSvCParamROE 55 3.5.19 TPUDSSvCParamROERe commendedserviceID 57 3.5.20 TPUDSSVCParamLC 58 3.5.21 TPUDSSvcParamLCBaudrateidentifier 59 3.5.22 TPUDSSVCParamDI 60 3.5.23 TPUDSSVCParamRDBPI 64 3.5.24 TPUDSSVCParamDDDI 65 3,525 TPUDSSyCParamRDTCI 66 PCAN-UDS APi- User Manual 3.5.26 TPUDSSVCParamRDTCI DTCSVM 69 35.27 TPUDSSYCParamIOCBI 70 3.5.28 TPUDSSvCParamRC 3.5.29 TPUDSSVCParaMRC RID 72 3.6 Methods 73 3.6.1 Initialize 75 3.6.2 Initialize(TpudsCanhandle, tpudsbaudrate) 3.6.3 Initialize(TPUdsCANhandle, TPUdSBaudrate, TPudSHWType, UInt32, UInt16) 8 3.6.4 Uninitialize 81 3.6.5 Setvalue 84 3.6.6 Setvalue (TPUdsCanhandle, tpudsparameter, UInt32, uint32) 84 3.6 Setvalue (TPUdSCaNHandle, TPUDSParameter, stringBuffer Uint32) 87 3.6.8 Setvalue (TPUDSANHandle, TPUDSParameter, Byte[], Uint32) 88 3.6.9 Setvalue(Tpudscanhand le, tpudsparameter, IntPtr, UInt32) 3.6.10 Getvalue 93 3.6.11 Getvalue (TPUDSCANHandle, TPUDSParameter, StringBuffer Uint32) 93 3.6. 12 Getvalue (TPUDSCANHandle, tpudsparameter, uint32, Uint32) 96 3.6.13 Getvalue (TPUDsCaNHandle, TPUDSParameter, Byte l], UInt32) 99 3.6. 14 Getvalue (TPUdSCAnhandle, tpudSParameter, Intptr, UInt32) 101 3.6.15 Getstatus 104 3.6.16Read 107 3.6.17 Write 3.6.18 Reset 114 3.6.19 WaitForsing lemessage 116 3. 6.20 WaitFormultiplemessage 120 3.6.21 Waitforseryice 126 3.6.22 WaitForservicefunctional 130 3.6.23 ProcessResponse 133 3.6. 24 SvCDiagnosticsessioncontro l 138 3.6.25 SVCECUReset 141 3.6.26 SvcSecuri tyAccess 145 3.6.27 SvCCommunicationControl 148 3.6.28 SvcTesterpresent 152 3.6.29 SvcsecuredDataTransmission 155 3.6.30 SvcControlDTCSetting 158 3.6.31 SvcResponseonEvent 162 3.6.32 SVCLinkcontrol 166 3.6.33 SVCReaddatabyidentifier 170 3.6. 34 SvcReadMemory ByAddress 173 3.6.35 SvcReadscal ingdatabyidentifier 177 3.6. 36 SvcReadDataByperiodicIdentifier 180 3.6.37 SvcDynamicallydefinedataIdentifierDBID 184 3.6.38 SvcDynamicall ydefineDataIdentifierDBMA 188 3.6. 39 SvcDynamical lyDefineDataIdentifierCDDDI 193 3.6.40 SvcWri teDataByidentifier 197 3.6. 41 Svcwri teMemory byaddress 200 3.6.42 SvcClearDi agnosticInformation 205 3. 6. 43 SVCReadDTCInformation 208 3.6.44 SvCReadDTCInformationRDTCSSBDTC 211 3. 6. 45 SvCReaddTCInformationRDTCSSBRN 215 PCAN-UDS APi- User Manual 3. 6.46 SVcReadDTCInformationReportExtended 218 3.6. 47 SvcReadDTCInformationReportseverity 221 3,648 SvcReaddTCInformationrsIodtc 225 3. 6.49 SvCReadDTCInformationNoParam 228 3.6.50 SvcInputout put contro byidentifier 232 3. 6.51 SyCRoutineControl 236 3.6.52 SvCReques tOwn load 239 3.6.53 SvcRequestUp load 243 3. 6.54 SVCTransferData 248 3.6.55 SvCRequestTransferExit 251 3.7 Functions 256 3.7.1 UDS Initialize 258 3.7.2 UDs Uninitialize 259 3.7.3 UDs Setvalue 260 3.7.4 UDs Getvalue 261 3.7.5 UDS Getstatus 262 3.7.6 UDS Read 264 3.7.7 UDs Write 265 3.7.8 UDs Reset 266 3.7.9 UDS_WaitForsinglemessage 267 3.7.10 UDS_waitForMultipleMessage 269 3.7.11 UDs Wai ce 272 3.7.12 UDS WaitForserviceFunctional 273 3.7.13 UDS_ Processresponse 275 3.7.14 UDS_SvcDiagnosticSessionControl 277 3.7.15 UDS SVCECUReset 278 3.7.16 DS_SVCSecuri tyAccess 280 3.7.17 UDS SVCCommunicationcontrol 281 3.7.18 UDs SvCTesterpresent 283 3719 UDS SvCSecuredDatatransmission 284 3.7.20 UDS_SvCControlDTCSetting 286 3.7.21 UDS_SVCResponseonEvent 287 3,7.22 UDs SVCLinkcontrol 289 3.7.23 UDS_SvcReaddatabyidentifier 291 3.7.24 UDS_SvcReadMemory byAddress 292 3.7.25 uDs_ SvcReadscalingdatabyidentifier 294 3.7.26 UDS_SvCReadDataBy Periodi iDentifier 295 3.7. 27 UDS_SVcDynamical l yDefineDataIdentifierDBID 297 3.7.28 UDS_SvcDynami call ydefinedataIdentifierDBMa 299 3.7.29 UDS_SvcDynami cal l yDefineDataIdentifierCDDDI 301 3. 7.30 UDS_SvcWriteDataByIdentifier 302 3,7.31 UDs SvcWri teMemorybyaddress 303 3.7. UDS_SvcClearDiagnosticInformation 305 3.7.33 UDS SVCReadDTCInformation 307 3.7. UDs SyCReadDTCInformationRdtCSSBDTC 309 3.7.35 uDs SvCReadDTCInformationRdtcssbrn 310 3.7.36 UDS_ SvCReadDTCInformationReportExtended 311 3.7.37 UDS_SvcReadDTCInformationReportseverity 313 3.7.38 UDS SVCReadDTCInformationRSIODTC 315 3,739 UDS SVCReadDTCInformationNoParam 316 3. 7.40 UDS_SvcInputoutput contro l byIdentifier 3,7. 41 UDs SyCRoutinecontrol 319 PCAN-UDS APi- User Manual 3.7.42 UDS_SvcRequestDown load 321 3.7.43 UDS_ SVCRequestupload 323 37.44 UDS SyCTransferData 325 3.7.45 UDS_SVCRequestTransferExit 326 3.8 Definitions 329 3.8.1 PCAN-UDS Handle Definitions 329 3.8.2 Parameter value defintions 331 3.8.3 TPUDSMsg Member value Definitions 332 3.8.4 PCAN-UDs Service parameter Definitions 333 4 Additional Information 335 4.1 PCAn Fundamentals 335 42 PCAN-Basic 336 4.3 UDS and ISO-TP Network Addressing Information 338 4.3.1 ISO-TP network addressing format 338 4.4 USing Events 340 5 License Information 342 6 PCAN-UDS APi- User Manual 1 PCAn-UDS APi Documentation Welcome to the documentation of PCan-UD APl, a PEAK CAN API that implements ISo 15765-3, UDS in CAN an international standard that allows a diagnostic tester(client) to control diagnostic functions in an on-vehicle Electronic Control Unit(ECU or serve In the following chapters you will find all the information needed to take advantage of this aPl Introduction on page 8 DLL API Reference on page 10 Additional Information on page 335 PCAN-UDS APi- User Manual 2 Introduction PCAN-UDS is a simple programming interface intended to support windows automotive applications that use PEAK-Hardware to communicate with Electronic Control Units(ECU) connected to the bus systems of a car, for maintenance purpose 2.1 Understanding PCAN-UDS UDS stands for Unified Diagnostic Services and is a communication protocol of the automotive industry. this protocol is described in the norm iSo 14229-1 The UDS protocol is the result of 3 other standardized diagnostic communication protocols IS0 14230-3, as known as Keyword 2000 Protocol(KWP2000 L IS0 15765-3, as known as diagnostic on CAN ISo 15765-2, as known as ISo-TP The idea of this protocol is to contact all electronic data units installed and CAN OBDn interconnected in a car, in order to provide maintenance, as checking for errors, actualizing of firmware, etc UDS is a Client/Server oriented protocol. In a UDS session(diagnostic session ),a program application on a computer constitutes the client(within UDS, it is called PCAN-UDS Tester), the server is the ecu being tested and the diagnostic requests from client to server are called services. The client always starts with a request and this ends with a positive or negative response from the server(ECu Since the transport protocol of UDS is done using ISo-TP, an international standard PCAN ISOTP for sending data packets over a CAN Bus, the maximum data length that can be transmitted in a single data-block is 4095 bytes. PCAN-UDS API is an implementation of the Uds on CAN standard the physical communication is carried out by PCAN-Hardware (PCAN-USB, PCAN-PCI etc )through PCAN-Basi the pCAN-ISo-TP and PCAN-Basic API (free CAN APls from PEAK-System). Because of this it is necessary to have also the pCAN-1S0-tP and PCAN-Basic APls(PCAN-ISO- TP. dll and PCAN Basic. dll) present on the working computer where UdS is intended to be used. PCAN-UDS, PCAN-ISO-TP and PCan-Basic apis are free and available for all Figure 1: Relationship of the people that acquire a pCAn-hardware 2.2 Using PCAN-UDS Since PCAN-UDS API is built on top of the PCAN-1So-TP API and PCAN-Basic APls, it shares similar functions. It offers the possibility to use several PCAn-UDS (PUds) channels within the same application in an easy way. The communication process is divided in 3 phases: initialization interaction and finalization of a puds-channel Initialization In order to do UDS on CAN communication using a channel, it is necessary to initialize it first. This is done by making a call to the function UDS_ Initialize (class- method: Initialize PCAN-UDS APi- User Manual Interaction: After a successful initialization a channel is ready to communicate with the connected can bus. Further configuration is not needed the 24 functions starting with UDS Svc(class-methods: starting with Svc can be used to transmit UdS requests and the utility functions starting with Uds WaitFor(class- methods starting with WaitFor) are used to retrieve the results of a previous request. the Uds read and UDS Write (class-methods: Read and Write are lower level functions to read and write UDs messages from scratch. If desired, extra configuration can be made to improve a communication session, like service request timeouts or ISo-TP parameters Finalization: When the communication is finished, the function UDS_ Uninitialize(class-method: Uninitialize should be called in order to release the puds-channel and the resources allocated for it. In this way the channel is marked as free"and can be used from other applications 23 Features I mplementation of the UDS protocol(iSo 14229-1)for the communication with control units Windows DLLs for the development of 32-bit and 64-bit applications Physical communication via Can using a Can interface of the pcan series Uses the pcan-Basic programming interface to access the can hardware in the computer Uses the pCAn-ISo-TP programming interface(iso 15765-2)for the transfer of data packages up to 4095 bytes via the can bus 2.4 System Requi rements L- Windows 10, 8.1, 7(32/64-bit At least 512 Mb ram and 1 GHz CPU PC CAN interface from peak-System PCAN-Basic APl L PCAN-SO-TP API 2.5 Scope of supply Interface DLL, examples, and header files for all common programming languages Documentation in pdf format Documentation in HTML Help format PCAN-UDS APi- User Manual 3 DLL API Reference This section contains information about the data types (classes, structures, types, defines enumerations)and API functions which are contained in the pcan-uds api 3.1 Namespaces PEAK offers the implementation of some specific programming interfaces as namespaces for the. NEt Framework programming environment. The following namespaces are available: Namespaces Name Description } Peak Contains all namespaces that are part of the managed programming environment from PEAK-System Peak Can Contains types and classes for using the PCan aPi from PEAK-System Peak Can. Light Contains types and classes for using the PCAn-Light API from PEAK-System Peak Can basic Contains types and classes for using the pcan-Basic APl from PEAK-System Peak Can Ccp Contains types and classes for using the CCP API implementation from PEAK-System Peak Can Xcp Contains types and classes for using the XcP aPi implementation from PEAK-System Peak Can. Iso Tp Contains types and classes for using the pCAN-IS0-TP aPl implementation from PEAK Systel Peak Can, Uds Contains types and classes for using the PCan-UDS API implementation from PEAK-System PeakCan.Obdll Contains types and classes for using the PCAN-OBDIll API implementation from PEAK System t} Peak. Lin Contains types and classes used to handle with lin devices from PEAK-System t} Peak. RP1210A Contains types and classes used to handle with can devices from PEak-System through the TMC Recommended Practices 1210, version A, as known as RP1210(A 3.1.1 Peak Can Uds The peak Can. Uds namespace contains types and classes to use the pcan-UdS aPi within the. NET Framework programming environment and handle pcan devices from peak-System Remarks: Under the delphi environment, these elements are enclosed in the puds-Unit. the functionality of all elements included here is just the same. the difference between this namespace and the delphi unit consists in the fact that delphi accesses the Windows api directly it is not managed code) Aliases Alias Description TPUDSCANHandle Represents a pCAn-UDS channel handle Classes Class Description 像曰 UDSApi Defines a class which represents the PCAN-UDS API 10 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论