You are on page 1of 45

EasyPDU API User Manual

Software Version 1.01

Softing Automotive Electronics GmbH


Richard-Reitzner-Allee 6
85540 Haar, Germany

Tel: +49 (0) 89 4 56 56 - 420


Fax: +49 (0) 89 4 56 56 - 399
info.automotive@softing.com
www.softing.com
Contents

1 Mainpage 2
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 What the EasyPDU API provides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Supported D-PDU APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Supported VCI hardware devices and protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 EasyPDU Demo Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Protocol/Bustype/Port combinations for supported VCIs 5


2.1 EDICblue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 EDICcard2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 EDICpci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 EDICusb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5 EDICwlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6 VCI_HSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7 VCI_HSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.8 VCI_HS_LIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.9 VCI_HS_PLUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.10 VCI_HS_WLAN_HD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3 Tutorial 13
3.1 EasyPDU examples for Microsoft Visual Studio 2010 . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 FAQ 13
4.1 Questions concerning EasyPDU C++ API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1.1 I get an unhandled Exception error while running EasyPDUCpp . . . . . . . . . . . . . . . 13

5 Namespace Index 13
5.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

6 Class Index 14
6.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

7 Namespace Documentation 14
7.1 EasyPDU Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.1.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

CONTENTS ii
8 Class Documentation 20

8.1 Cop Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

8.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

8.1.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

8.2 EasyPduException Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

8.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

8.2.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

8.3 Link Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

8.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

8.3.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

8.4 Pduapi Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

8.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

8.4.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

8.5 Response Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

8.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

8.5.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

8.6 Vci Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

8.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

8.6.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

9 Example Documentation 34

9.1 ComParam.ini . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

9.2 example_1.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

9.3 example_1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

9.4 example_1.py . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

9.5 example_2.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Index40

CONTENTS 1
1 Mainpage

• Introduction

• System Requirements

• What the EasyPDU API provides

• Supported D-PDU APIs

• Supported VCI hardware devices and protocols

• EasyPDU Demo Application

1.1 Introduction

This document includes getting started information and a function reference for the EasyPDU, an API on top of the
D-PDU API that allows simple access for the most common API functions. The D-PDU API, as an internationally
standardized programming interface has gained widespread adoption in the industry over the last years. It provides
full access to all important vehicle diagnostic protocols and is supported by a variety of diagnostic kernels and user
applications. However, there is one draw-back to this "one size fits all" approach: The D-PDU API is in no way
easy to handle. When a programmer intends to create a simple application, based on a diagnostic protocol, and
designed only for a very specific and limited purpose, this can be achieved with the D-PDU API - but unfortunately
not in an easy way. Literally dozens of calls to D-PDU API functions, several memory allocations (and also memory
releases), handling of different types of handles (module handles, ComLogicalLink handles, ComPrimitive handles)
are required, in order to send one single diagnostic message to a vehicle interface. This situation creates a strong
desire for a simpler, more condensed variant of a D-PDU API, where basic vehicle communication can be achieved
with a bare minimum of required calls to the D-PDU API.

Figure 1: EasyPDU architecture diagram

1 Mainpage 2
1.2 System Requirements

In order to use the EasyPDU API for your own application, you need:

• a Softing or Samtec D-PDU API installed on your PC

• a supported vehicle communication interface (VCI) hardware device connected to your PC and configured
with your D-PDU API

• an integrated development environment (IDE) for at least one of the supported programming languages: C++,
Visual Basic, C#, Python

• the EasyPDU API library files for your particular programming language

1.3 What the EasyPDU API provides

• support for several programming languages:

– C++
– C#
– Visual Basic
– other dotNET languages
– Python

• object-oriented access to D-PDU API functionality:

– class Pduapi for simple D-PDU API abstraction


– class Vci for convenient access to your module VCI hardware
– class Link as a simplified abstraction of D-PDU APIs ComLogicalLinks
– class Cop for sending and receiving data
– class EasyPduException for receiving user friendly error messages

1.4 Supported D-PDU APIs

The EasyPDU supports following D-PDU APIs:

• Softing D-PDU API for VCIs (Softing Automotive Electronics GmbH)


http://automotive.softing.com/de/produkte/d-pdu-api-iso-22900-2.html

• samPDU (samtec automotive software & electronics GmbH)


http://www.samtec.de/hauptmenu/produkte/software/sampdu-api

1.5 Supported VCI hardware devices and protocols

For a complete list of all supported VCI hardware devices and protocols see Protocol/Bustype/Port combinations for
supported VCIs.

1.2 System Requirements 3


1.6 EasyPDU Demo Application

The EasyPDU_GUI.exe is a graphical demo application that uses the EasyPDU API. Before you start to write your
own application it may be useful to check your D-PDU API installation and VCI configuration with this demo GUI:

Figure 2: EasyPDU_GUI.exe screenshot

1. Start EasyPDU_GUI.exe.

2. Select D-PDU API from drop-down list. If no D-PDU API is available, check your D-PDU API installation and
your RootDescriptionFile.

3. Click on "load PDUAPI".

4. Select VCI hardware device from drop-down list. If no VCI is available, check whether your VCI is connected
to your PC an installed correctly using the tools installed with your D-PDU API. Also check whether your VCI
is supported.

5. Click on "connect VCI". If you use a W-LAN device an get an connection error open the Windows wireless
lan connections and see if your VCI is connected. If so, you can try to disconnect an reconnect the VCI.

1.6 EasyPDU Demo Application 4


6. Select protocol, bus-type and port depending on the bus your VCI hardware is connected to. See Protocol/←-
Bustype/Port combinations for supported VCIs for a list of supported Protocol/Bustype/Port combinations for
your VCI.

7. Click on "open LINK".

8. Click on "read ComParams and UniqueRespIdTable from .ini file" and select a .ini file with your configuration.
There is an example ComParam.ini file, but depending on your bus configuration you have modify it.

9. Click on "connect LINK".

10. Type your PDU in comma separated decimal or 0xHEX notation (for example: "10,92") and click "send"-button
in order to start a diagnostic session.

• If there is a ECU with the default identifier of your D-PDU API for this protocol, you will get
R RespId(1): 50 92
as a positive response.
• If there is no ECU with the default identifier of your D-PDU API for this protocol, you will get
R Error: RX_TIMEOUT: P2 timeout
as a timeout error.
• If you get an other error, there seems to be something wrong with your bus.

2 Protocol/Bustype/Port combinations for supported VCIs

This list shows all Protocol/Bus/Port combinations that are possible with the appropriate VCIs.
Following VCIs are supported:

• EDICblue

• EDICcard2

• EDICpci

• EDICusb

• EDICwlan

• VCI_HSC

• VCI_HSX

• VCI_HS_LIGHT

• VCI_HS_PLUS

• VCI_HS_WLAN_HD

2.1 EDICblue

PROTOCOL BUSTYPE PORT


ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1

2 Protocol/Bustype/Port combinations for supported VCIs 5


ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN1
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN1
MSP_SFTNG_CAN ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART KL_LINE
14230_2
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART K_LINE
14230_2
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN1
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART KL_LINE
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART KL_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART K_LINE
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN1
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN1
onboard
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN1

2.2 EDICcard2

PROTOCOL BUSTYPE PORT


ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN2
ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN2
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN2

2.2 EDICcard2 6
ISO_11898_RAW ISO_11898_2_DWCAN CAN2
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN1
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN2
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN2
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN1
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN2
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN2
MSP_SFTNG_CAN ISO_11898_3_DWFTCAN CAN1
MSP_SFTNG_CAN ISO_11898_3_DWFTCAN CAN2
MSP_SFTNG_CAN ISO_11898_3_DWFTCAN CAN2
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART KL_LINE
14230_2
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART K_LINE
14230_2
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN2
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN2
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART KL_LINE
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART KL_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART K_LINE
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN2
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN2
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN1
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN2
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN2
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN1
onboard

2.2 EDICcard2 7
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN2
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN2
onboard
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN1
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN2
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN2

2.3 EDICpci

PROTOCOL BUSTYPE PORT


ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN2
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN1
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN1
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN2
MSP_SFTNG_CAN ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART KL_LINE
14230_2
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART K_LINE
14230_2
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN1
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART KL_LINE
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART KL_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART K_LINE
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN2

2.3 EDICpci 8
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN1
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN2
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN1
onboard
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN1

2.4 EDICusb

PROTOCOL BUSTYPE PORT


ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN2
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN1
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN1
MSP_SFTNG_CAN ISO_11898_2_DWCAN CAN2
MSP_SFTNG_CAN ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART KL_LINE
14230_2
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART K_LINE
14230_2
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN1
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART KL_LINE
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART KL_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART K_LINE
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN2
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN1
onboard

2.4 EDICusb 9
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN2
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN1
onboard
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN1

2.5 EDICwlan

PROTOCOL BUSTYPE PORT


ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_15765_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN2
ISO_14230_3_on_ISO_15765_2 ISO_11898_3_DWFTCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN2
ISO_11898_RAW ISO_11898_3_DWFTCAN CAN1
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_9141_2_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART KL_LINE
14230_2
MSP_VW2000LP_on_ISO_←- ISO_9141_2_UART K_LINE
14230_2
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP20 ISO_11898_3_DWFTCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_VW2000LP_on_TP16 ISO_11898_3_DWFTCAN CAN1
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART KL_LINE
MSP_KW1281_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART KL_LINE
ISO_OBD_on_K_Line ISO_9141_2_UART K_LINE
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN2
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN1
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_2_DWCAN CAN2
onboard
MSP_SFTNG_ISO_11898_←- ISO_11898_3_DWFTCAN CAN1
onboard

2.5 EDICwlan 10
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN1
MSP_KW1281_on_TP16 ISO_11898_2_DWCAN CAN2
MSP_KW1281_on_TP16 ISO_11898_3_DWFTCAN CAN1

2.6 VCI_HSC

PROTOCOL BUSTYPE PORT


ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15031_5_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
SAE_J1939_73_on_SAE_J1939←- SAE_J1939_11_DWCAN CAN1
_21

2.7 VCI_HSX

PROTOCOL BUSTYPE PORT


ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15031_5_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
SAE_J1939_73_on_SAE_J1939←- SAE_J1939_11_DWCAN CAN1
_21
MSP_MOST_14229_on_MOST←- MOST MOST_PORT
_DAP
ISO_14230_3_on_ISO_14230_2 ISO_14230_1_UART K_LINE
ISO_14230_3_on_ISO_14230_2 ISO_14230_1_UART L_LINE
ISO_15031_5_on_ISO_14230_4 ISO_14230_1_UART K_LINE
ISO_OBD_on_K_Line ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_9141_2 ISO_9141_2_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_14230_1_UART K_LINE
14230_2
MSP_KW71_UART ISO_9141_2_UART KL_LINE

2.8 VCI_HS_LIGHT

PROTOCOL BUSTYPE PORT


ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15031_5_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1

2.6 VCI_HSC 11
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
SAE_J1939_73_on_SAE_J1939←- SAE_J1939_11_DWCAN CAN1
_21
MSP_KW500_3_on_KW500_2 KW500_1_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_14230_4 ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_14230_1_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_14230_1_UART K_LINE
14230_2
MSP_KW71_UART ISO_9141_2_UART KL_LINE

2.9 VCI_HS_PLUS

PROTOCOL BUSTYPE PORT


ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15031_5_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
SAE_J1939_73_on_SAE_J1939←- SAE_J1939_11_DWCAN CAN1
_21
MSP_KW500_3_on_KW500_2 KW500_1_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_14230_4 ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_14230_1_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_14230_1_UART K_LINE
14230_2
MSP_KW71_UART ISO_9141_2_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_14230_1_UART L_LINE

2.10 VCI_HS_WLAN_HD

PROTOCOL BUSTYPE PORT


ISO_14230_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15765_3_on_ISO_15765_2 ISO_11898_2_DWCAN CAN1
ISO_15031_5_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
ISO_OBD_on_ISO_15765_4 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP20 ISO_11898_2_DWCAN CAN1
MSP_VW2000LP_on_TP16 ISO_11898_2_DWCAN CAN1
ISO_11898_RAW ISO_11898_2_DWCAN CAN1
SAE_J1939_73_on_SAE_J1939←- SAE_J1939_11_DWCAN CAN1
_21

2.9 VCI_HS_PLUS 12
MSP_KW500_3_on_KW500_2 KW500_1_UART KL_LINE
ISO_14230_3_on_ISO_14230_2 ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_14230_4 ISO_14230_1_UART K_LINE
ISO_15031_5_on_ISO_9141_2 ISO_9141_2_UART K_LINE
ISO_OBD_on_K_Line ISO_14230_1_UART K_LINE
MSP_VW2000LP_on_ISO_←- ISO_14230_1_UART K_LINE
14230_2
MSP_KW71_UART ISO_9141_2_UART KL_LINE

3 Tutorial

3.1 EasyPDU examples for Microsoft Visual Studio 2010

In the examples folder, you can find short code examples for every supported programming language. These
examples are well documentated an can be uses as a basis for your own EasyPDU application. For simplification,
the example folders for the diffenent programming languages each contain all required dll in order to compile and run
the example "out of the box". Nevertheless, you have to do some modifications to the ComParam.ini file, depending
on your particular bus configuration.

• for C++:

– example_1.cpp is a very basic example for sending/receiving data with a VCI

• for C#:

– example_1.cs is a very basic example for sending/receiving data with a VCI


– example_2.cs uses different threads for sending and receiving data with the same VCI

• for Python:

– example_1.cs is a very basic example for sending/receiving data with a VCI

4 FAQ

4.1 Questions concerning EasyPDU C++ API

4.1.1 I get an unhandled Exception error while running EasyPDUCpp

• when using Visual Studio, make sure you have compiled with /MD or /MDd

• make sure that boost_thread-xxxxxxx.dll is in the same folder as EasyPDUCpp.dll

• if the exception is of type EasyPduException you can catch it in order to get more information

5 Namespace Index

5.1 Namespace List

Here is a list of all documented namespaces with brief descriptions:

3 Tutorial 13
EasyPDU
Namespace for the EasyPDU C++ API 14

6 Class Index

6.1 Class List

Here are the classes, structs, unions and interfaces with brief descriptions:

Cop
Class for convenient communication primitive access. 20

EasyPduException
This Exception is thrown whenever something went wrong in an EasyPDU function. 22

Link
Class for convenient access to a ComLogicalLink. 23

Pduapi
Class for convenient D-PDU API access. 27

Response
Class for convenient Cop-Response access. 30

Vci
Class for convenient VCI hardware device access. 32

7 Namespace Documentation

7.1 EasyPDU Namespace Reference

Namespace for the EasyPDU C++ API

Classes

• class Cop
Class for convenient communication primitive access.
• class EasyPduException
This Exception is thrown whenever something went wrong in an EasyPDU function.
• class Link
Class for convenient access to a ComLogicalLink.
• class Pduapi
Class for convenient D-PDU API access.
• class Response
Class for convenient Cop-Response access.
• class Vci
Class for convenient VCI hardware device access.

6 Class Index 14
Enumerations

• enum VCITYPE {
EDICblue, EDICcard2, EDICpci, EDICusb,
EDICwlan, VCI_HSC, VCI_HSX, VCI_HS_LIGHT,
VCI_HS_PLUS, VCI_HS_WLAN_HD }
VCI Type
• enum PROTOCOL {
ISO_11898_RAW, ISO_14230_3_on_ISO_14230_2, ISO_14230_3_on_ISO_15765_2, ISO_15031_5_on←-
_ISO_14230_4,
ISO_15031_5_on_ISO_15765_4, ISO_15031_5_on_ISO_9141_2, ISO_15765_3_on_ISO_15765_2, ISO←-
_OBD_on_ISO_15765_4,
ISO_OBD_on_K_Line, MSP_KW1281_on_ISO_9141_2, MSP_KW1281_on_TP16, MSP_KW500_3_on_←-
KW500_2,
MSP_KW71_UART, MSP_MOST_14229_on_MOST_DAP, MSP_SFTNG_CAN, MSP_SFTNG_ISO_←-
11898_onboard,
MSP_VW2000LP_on_ISO_14230_2, MSP_VW2000LP_on_TP16, MSP_VW2000LP_on_TP20, SAE_←-
J1939_73_on_SAE_J1939_21 }
Protocol
• enum BUSTYPE {
ISO_11898_2_DWCAN, ISO_11898_3_DWFTCAN, ISO_14230_1_UART, ISO_9141_2_UART,
KW500_1_UART, MOST, SAE_J1939_11_DWCAN }
Bustype
• enum PORT {
CAN1, CAN2, KL_LINE, K_LINE,
L_LINE, MOST_PORT }
Port on the VCI.
• enum COP_TYPE { STARTCOMM, STOPCOMM, SENDRECV, UPDATEPARAM }
Type of the Cop.
• enum T_PDU_ERROR {
PDU_STATUS_NOERROR = 0x00000000, PDU_ERR_FCT_FAILED = 0x00000001, PDU_ERR_RESER←-
VED_1 = 0x00000010, PDU_ERR_COMM_PC_TO_VCI_FAILED = 0x00000011,
PDU_ERR_PDUAPI_NOT_CONSTRUCTED = 0x00000020, PDU_ERR_SHARING_VIOLATION =
0x00000021, PDU_ERR_RESOURCE_BUSY = 0x00000030, PDU_ERR_RESOURCE_TABLE_CHAN←-
GED = 0x00000031,
PDU_ERR_RESOURCE_ERROR = 0x00000032, PDU_ERR_CLL_NOT_CONNECTED = 0x00000040,
PDU_ERR_CLL_NOT_STARTED = 0x00000041, PDU_ERR_INVALID_PARAMETERS = 0x00000050,
PDU_ERR_INVALID_HANDLE = 0x00000060, PDU_ERR_VALUE_NOT_SUPPORTED = 0x00000061,
PDU_ERR_ID_NOT_SUPPORTED = 0x00000062, PDU_ERR_COMPARAM_NOT_SUPPORTED =
0x00000063,
PDU_ERR_COMPARAM_LOCKED = 0x00000064, PDU_ERR_TX_QUEUE_FULL = 0x00000070, PDU_←-
ERR_EVENT_QUEUE_EMPTY = 0x00000071, PDU_ERR_VOLTAGE_NOT_SUPPORTED = 0x00000080,
PDU_ERR_MUX_RSC_NOT_SUPPORTED = 0x00000081, PDU_ERR_CABLE_UNKNOWN = 0x00000082,
PDU_ERR_NO_CABLE_DETECTED = 0x00000083, PDU_ERR_CLL_CONNECTED = 0x00000084,
PDU_ERR_TEMPPARAM_NOT_ALLOWED = 0x00000090, PDU_ERR_RSC_LOCKED = 0x000000←-
A0, PDU_ERR_RSC_LOCKED_BY_OTHER_CLL = 0x000000A1, PDU_ERR_RSC_NOT_LOCKED =
0x000000A2,
PDU_ERR_MODULE_NOT_CONNECTED = 0x000000A3, PDU_ERR_API_SW_OUT_OF_DATE =
0x000000A4, PDU_ERR_MODULE_FW_OUT_OF_DATE = 0x000000A5, PDU_ERR_PIN_NOT_CON←-
NECTED = 0x000000A6 }
Original D-PDU API error code.

7.1 EasyPDU Namespace Reference 15


• enum T_PDU_ERR_EVT {
PDU_ERR_EVT_NOERROR = 0x00000000, PDU_ERR_EVT_FRAME_STRUCT = 0x00000100, PDU_E←-
RR_EVT_TX_ERROR = 0x00000101, PDU_ERR_EVT_TESTER_PRESENT_ERROR = 0x00000102,
PDU_ERR_EVT_RSC_LOCKED = 0x00000109, PDU_ERR_EVT_RX_TIMEOUT = 0x00000103, PDU_E←-
RR_EVT_RX_ERROR = 0x00000104, PDU_ERR_EVT_PROT_ERR = 0x00000105,
PDU_ERR_EVT_LOST_COMM_TO_VCI = 0x00000106, PDU_ERR_EVT_VCI_HARDWARE_FAULT =
0x00000107, PDU_ERR_EVT_INIT_ERROR = 0x00000108 }
Original D-PDU API event error code.
• enum T_PDU_STATUS {
PDU_COPST_IDLE = 0x8010, PDU_COPST_EXECUTING = 0x8011, PDU_COPST_FINISHED = 0x8012,
PDU_COPST_CANCELLED = 0x8013,
PDU_COPST_WAITING = 0x8014, PDU_CLLST_OFFLINE = 0x8050, PDU_CLLST_ONLINE = 0x8051, P←-
DU_CLLST_COMM_STARTED = 0x8052,
PDU_MODST_READY = 0x8060, PDU_MODST_NOT_READY = 0x8061, PDU_MODST_NOT_AVAIL =
0x8062, PDU_MODST_AVAIL = 0x8063 }
Original D-PDU API status code. This enum contains status codes for ComPrimitives, ComLogicalLinks and Modules

7.1.1 Detailed Description

Namespace for the EasyPDU C++ API

EasyPDU Pduapi Vci Link Cop Response

7.1.2 Enumeration Type Documentation

7.1.2.1 enum BUSTYPE

Bustype

Enumerator

ISO_11898_2_DWCAN CAN according to ISO 11898 High Speed


ISO_11898_3_DWFTCAN CAN according to ISO 11898 Low Speed
ISO_14230_1_UART K-Line according to ISO 14230
ISO_9141_2_UART K-Line interface as defined in ISO 9141
KW500_1_UART K-Line according to ISO 9141
MOST MOST Bus according to MOST Cooperation
SAE_J1939_11_DWCAN Dual-Wire CAN according to J1939

7.1 EasyPDU Namespace Reference 16


7.1.2.2 enum COP_TYPE

Type of the Cop.

Enumerator

STARTCOMM Start communication.


STOPCOMM Stop communication.
SENDRECV Send and/or receive data.
UPDATEPARAM Update comparams and make them active.

7.1.2.3 enum PORT

Port on the VCI.

Enumerator

CAN1 Can be used for CAN-lowspeed and CAN-highspeed if supported by VCI. If the module has seperated
CAN ports for higspeed and lowspeed like the EDICblue use CAN1 for highspeed.
CAN2 Can be used for CAN-lowspeed and CAN-highspeed if supported by VCI. If the module has seperated
CAN ports for higspeed and lowspeed like the EDICblue use CAN2 for lowspeed.
KL_LINE KL-Line port.
K_LINE K-Line port.
L_LINE L-Line port.
MOST_PORT MOST port.

7.1.2.4 enum PROTOCOL

Protocol

Enumerator

ISO_11898_RAW CAN RAW protocol


ISO_14230_3_on_ISO_14230_2 KWP2000GV
ISO_14230_3_on_ISO_15765_2 DiagCAN
ISO_15031_5_on_ISO_14230_4 ISO OBD on KWP2000 K-Line
ISO_15031_5_on_ISO_15765_4 ISO OBD on CAN (ISO15765)
ISO_15031_5_on_ISO_9141_2 ISO OBD on 9141-2 K-Line
ISO_15765_3_on_ISO_15765_2 UDSCAN
ISO_OBD_on_ISO_15765_4 ISO OBD on CAN
ISO_OBD_on_K_Line ISO OBD on 9141-2 K-Line and KWP2000 K-Line
MSP_KW1281_on_ISO_9141_2 KWP1281 on K-Line
MSP_KW1281_on_TP16 KWP1281 on TP1.6
MSP_KW500_3_on_KW500_2 Deutz KW500 Diagnostics on K-Line
MSP_KW71_UART KW71 on K Line
MSP_MOST_14229_on_MOST_DAP UDS on MOST
MSP_SFTNG_CAN Softing CAN protocol

7.1 EasyPDU Namespace Reference 17


MSP_SFTNG_ISO_11898_onboard Softing CAN onboard protocol
MSP_VW2000LP_on_ISO_14230_2 VW2000LP
MSP_VW2000LP_on_TP16 KWP2000 on VW TP1.6
MSP_VW2000LP_on_TP20 KWP2000 on VW TP2.0
SAE_J1939_73_on_SAE_J1939_21 Truck and Bus on CAN

7.1.2.5 enum T_PDU_ERR_EVT

Original D-PDU API event error code.

Enumerator

PDU_ERR_EVT_NOERROR No Error. Event type only returned on a PDUGetLastError if there were no


previous errors for the requested handle
PDU_ERR_EVT_FRAME_STRUCT CLL/CoP Error: The structure of the received protocol frame is incorrect
(e.g. wrong frame number, missing FC...).
PDU_ERR_EVT_TX_ERROR CLL/CoP Error: Error encountered during tramsmit of a ComPrimitive PDU
PDU_ERR_EVT_TESTER_PRESENT_ERROR CLL/CoP Error: Error encountered in transmitting a Tester
Present message or in receiving an expected response to a Tester Present message.
PDU_ERR_EVT_RSC_LOCKED CLL Error: A physical ComParam was not set because of a physical Com←-
Param lock.
PDU_ERR_EVT_RX_TIMEOUT CLL/CoP Error: Receive timer (e.g. P2Max) expired with no expected re-
sponses received from the vehicle.
PDU_ERR_EVT_RX_ERROR CLL/CoP Error: Error encountered in receiving a mesage from the vehicle bus
(e.g. checksum error ...).
PDU_ERR_EVT_PROT_ERR CLL/CoP Error: Protocol error encountered during handling of a ComPrimitive
(e.g. if the protocol cannot handle the length of a ComPrimitive.
PDU_ERR_EVT_LOST_COMM_TO_VCI Module Error: Communication to a MVCI protocol module has been
lost.
PDU_ERR_EVT_VCI_HARDWARE_FAULT Module Error: The MVCI protocol module has detected a hard-
ware error.
PDU_ERR_EVT_INIT_ERROR CLL/CoP Error: A failure occurred during a protocol initialization sequence.

7.1.2.6 enum T_PDU_ERROR

Original D-PDU API error code.

Enumerator

PDU_STATUS_NOERROR No error for the function call


PDU_ERR_FCT_FAILED Function call failed (generic failure)
PDU_ERR_RESERVED_1 Reserved by ISO22900-2
PDU_ERR_COMM_PC_TO_VCI_FAILED Communication between host and MVCI Protocol Module failed
PDU_ERR_PDUAPI_NOT_CONSTRUCTED The D-PDU API has not yet been constructed
PDU_ERR_SHARING_VIOLATION A PDUDestruct was not called before another PDUConstruct
PDU_ERR_RESOURCE_BUSY the requested resource is already in use.

7.1 EasyPDU Namespace Reference 18


PDU_ERR_RESOURCE_TABLE_CHANGED Not used by the D-PDU API
PDU_ERR_RESOURCE_ERROR Not used by the D-PDU API
PDU_ERR_CLL_NOT_CONNECTED The ComLogicalLink cannot be in the PDU_CLLST_OFFLINE state to
perform the requested operation.
PDU_ERR_CLL_NOT_STARTED The ComLogicalLink must be in the PDU_CLLST_COMM_STARTE←-
D state to perform the requested operation.
PDU_ERR_INVALID_PARAMETERS One or more of the parameters supplied in the function are invalid.
PDU_ERR_INVALID_HANDLE One or more of the handles supplied in the function are invalid.
PDU_ERR_VALUE_NOT_SUPPORTED One of the option values in PDUConstruct is invalid
PDU_ERR_ID_NOT_SUPPORTED IOCTL command id not supported by the implementation of the D-PDU
API
PDU_ERR_COMPARAM_NOT_SUPPORTED ComParam id not supported by the implementation of the D-
PDU API
PDU_ERR_COMPARAM_LOCKED Physical ComParam cannot be changed because it is locked by another
ComLogicalLink.
PDU_ERR_TX_QUEUE_FULL The ComLogicalLink’s transmit queue is full; the ComPrimitive could not be
queued.
PDU_ERR_EVENT_QUEUE_EMPTY No more event items are available to be read from the requested
queue.
PDU_ERR_VOLTAGE_NOT_SUPPORTED The voltage value supplied in the IOCTL call is not supported by
the MVCI Protocol Module.
PDU_ERR_MUX_RSC_NOT_SUPPORTED The specified pin / resource are not supported by the MVC←-
I Protocol Module for the IOCTL call.
PDU_ERR_CABLE_UNKNOWN The cable attached to the MVCI Protocol Module is of an unknown type.
PDU_ERR_NO_CABLE_DETECTED No cable is detected by the MVCI Protocol Module
PDU_ERR_CLL_CONNECTED The ComLogicalLink is already in the PDU_CLLST_ONLINE state.
PDU_ERR_TEMPPARAM_NOT_ALLOWED Physical ComParams cannot be changed as a temporary
ComParam.
PDU_ERR_RSC_LOCKED The resource is already locked.
PDU_ERR_RSC_LOCKED_BY_OTHER_CLL The ComLogicalLink’s resource is currently locked by another
ComLogicalLink.
PDU_ERR_RSC_NOT_LOCKED The resource is already in the unlocked state.
PDU_ERR_MODULE_NOT_CONNECTED The module is not in the PDU_MODST_READY state.
PDU_ERR_API_SW_OUT_OF_DATE The API software is older than the MVCI Protocol Module Software
PDU_ERR_MODULE_FW_OUT_OF_DATE The MVCI Protocol Module software is older than the API soft-
ware.
PDU_ERR_PIN_NOT_CONNECTED The requested Pin is not routed by supported cable

7.1.2.7 enum T_PDU_STATUS

Original D-PDU API status code. This enum contains status codes for ComPrimitives, ComLogicalLinks and Mod-
ules

Enumerator

PDU_COPST_IDLE ComPrimitive is in the CommLogicalLink’s ComPrimitive Queue and has not been acted
upon.

7.1 EasyPDU Namespace Reference 19


PDU_COPST_EXECUTING ComPrimitive has been pulled from the CommLogicalLink’s ComPrimitive Queue
and is in an active state.
PDU_COPST_FINISHED ComPrimitive is finished. No further event items will be generated for this Com←-
Primitive.
PDU_COPST_CANCELLED ComPrimitive was cancelled by a PDUCancelComPrimitive request. No further
event items will be generated for this ComPrimitive.
PDU_COPST_WAITING A periodic send ComPrimitive (NumSendCycles > 1) has finished its periodic cycle
and is waiting for its next cyclic time for transmission.
PDU_CLLST_OFFLINE ComLogicalLink is in communication state "offline".
PDU_CLLST_ONLINE ComLogicalLink is in communication state "online".
PDU_CLLST_COMM_STARTED ComLogicalLink is in communication state "communication started". A
PDU_COPT_STARTCOMM ComPrimitive has been commanded. The ComLogicalLink is in a trans-
mit/receive state.
PDU_MODST_READY The MVCI Protocol Module is ready for communication. The MVCI Protocol Module
has been connected by this D-PDU API Session (See PDUModuleConnect)
PDU_MODST_NOT_READY The MVCI Protocol Module is not ready for communication.
PDU_MODST_NOT_AVAIL The MVCI Protocol Module is unavailable for connection. E.g. MVCI Protocol
Module is in use by another D-PDU API connection or communication was lost after previously being in a
PDU_MODST_READY state.
PDU_MODST_AVAIL The MVCI Protocol Module is available for connection (i.e. not yet connected by a
D-PDU API session.) See PDUModuleConnect and PDUModuleDisconnect)

7.1.2.8 enum VCITYPE

VCI Type

Enumerator

EDICblue EDICblue
EDICcard2 EDICcard2
EDICpci EDICpci
EDICusb EDICusb
EDICwlan EDICwlan
VCI_HSC samtec HSC VCI
VCI_HSX Samtec HSX VCI
VCI_HS_LIGHT Samtec HSlight USB VCI
VCI_HS_PLUS Samtec HS+ USB/Ethernet VCI
VCI_HS_WLAN_HD Samtec HS+ wLAN/HD VCI

8 Class Documentation

8.1 Cop Class Reference

Class for convenient communication primitive access.

8 Class Documentation 20
Public Member Functions

• void waitUntilFinished ()
Wait until Cop has finished successfully or with error.
• Response getResponse ()
Get a single response from this communication primitive.
• void cancel ()
Cancel communication primitive.
• T_PDU_STATUS getStatus ()
Get original Pduapi Cop status.

8.1.1 Detailed Description

Class for convenient communication primitive access.

EasyPDU Pduapi Vci Link Cop Response

Examples:

example_1.cpp.

8.1.2 Member Function Documentation

8.1.2.1 void cancel ( )

Cancel communication primitive.


Received responses can still be obtaint via getResponse().

8.1.2.2 Response getResponse ( )

Get a single response from this communication primitive.


If no response is available and Cop is still running, wait for next response. If no response is available and Cop has
finished, the returned response object evaluates false.

Returns

Response object. If it evaluates true, the response is valid.

Examples:

example_1.cpp.

8.1 Cop Class Reference 21


8.1.2.3 T_PDU_STATUS getStatus ( )

Get original Pduapi Cop status.

8.1.2.4 void waitUntilFinished ( )

Wait until Cop has finished successfully or with error.

8.2 EasyPduException Class Reference

This Exception is thrown whenever something went wrong in an EasyPDU function.

Public Member Functions

• virtual const char ∗ what () throw ()


Get EasyPduException error string.
• const T_PDU_ERROR getErrorCode () throw ()
Get original D-PDU API error code.

8.2.1 Detailed Description

This Exception is thrown whenever something went wrong in an EasyPDU function.

Examples:

example_1.cpp.

8.2.2 Member Function Documentation

8.2.2.1 const T_PDU_ERROR getErrorCode ( ) throw )

Get original D-PDU API error code.

Returns

T_PDU_ERROR returned by PDUAPI function

8.2.2.2 virtual const char∗ what ( ) throw ) [virtual]

Get EasyPduException error string.

Returns

Short user-readable description of the error.

Examples:

example_1.cpp.

8.2 EasyPduException Class Reference 22


8.3 Link Class Reference

Class for convenient access to a ComLogicalLink.

Public Member Functions

• void connect ()
Connect Link.
• void disconnect ()
Disconnect Link.
• bool isConnected ()
Determines if the Link is connected.
• Cop startCop (COP_TYPE copType, int sendCounter, int receiveCounter, std::vector< unsigned char >
dataBytes)
Start a Cop for sending and receiving data.
• Cop startCop (COP_TYPE copType, int sendCounter, int receiveCounter, std::string byteString)
Start a Cop for sending and receiving data.
• int getComParam (std::string name)
Get a communication parameter.
• void setComParam (std::string name, int value)
Set a communication parameter.
• void setComParam (std::string name, std::string value)
Set a communication parameter.
• int getUniqueRespIdTable (int uniqueRespIdentifier, std::string name)
Get a communication parameter from an UniqueRespIdTable.
• int getUniqueRespIdTable (std::string uniqueRespIdentifier, std::string name)
Get a communication parameter from an UniqueRespIdTable.
• void setUniqueRespIdTable (int uniqueRespIdentifier, std::string name, int value)
Set a communication parameter from an UniqueRespIdTable.
• void setUniqueRespIdTable (std::string uniqueRespIdentifier, std::string name, std::string value)
Set a communication parameter from an UniqueRespIdTable.
• void readAndSetParamsFromFile (std::string filename)
Read Comparams and UniqueResponseTable from a text file and set them.

8.3.1 Detailed Description

Class for convenient access to a ComLogicalLink.

EasyPDU Pduapi Vci Link Cop Response

Examples:

example_1.cpp.

8.3 Link Class Reference 23


8.3.2 Member Function Documentation

8.3.2.1 void connect ( )

Connect Link.
Connect Link after setComParam() and setUniqueRespIdTable() but before startCop().

Examples:

example_1.cpp.

8.3.2.2 void disconnect ( )

Disconnect Link.
After disconnecting Link you cannot startCop() until connect() is called again.

8.3.2.3 int getComParam ( std::string name )

Get a communication parameter.


Parameters
name Name of the communication parameter.

Returns

Current value of this ommunication parameter.

8.3.2.4 int getUniqueRespIdTable ( int uniqueRespIdentifier, std::string name )

Get a communication parameter from an UniqueRespIdTable.


Parameters
uniqueResp←- UniqueRespIdTable page identifier.
Identifier
name Name of the communication parameter.

Returns

Current value of this ommunication parameter.

8.3.2.5 int getUniqueRespIdTable ( std::string uniqueRespIdentifier, std::string name )

Get a communication parameter from an UniqueRespIdTable.


Parameters
uniqueResp←- UniqueRespIdTable page identifier.
Identifier

8.3 Link Class Reference 24


name Name of the communication parameter.

Returns

Current value of this ommunication parameter.

8.3.2.6 bool isConnected ( )

Determines if the Link is connected.

Returns

true = link is connected, false = link in not connected

8.3.2.7 void readAndSetParamsFromFile ( std::string filename )

Read Comparams and UniqueResponseTable from a text file and set them.
Parameters
filename Location of the parameter file.

Examples:

example_1.cpp.

8.3.2.8 void setComParam ( std::string name, int value )

Set a communication parameter.


Parameters
name Name of the communication parameter.
value New communication parameter value.

8.3.2.9 void setComParam ( std::string name, std::string value )

Set a communication parameter.


If type of ComParam type is BYTEFIELD or LONGFIELD use a space separated string: "123 456 789"
If type of ComParam type is STRUCTFIELD with SESSION_TIMING surround every parameter set with
parentheses: "(session P2Max_high P2Max_low P2Star_high P2Star_low)(...)"
If type of ComParam type is STRUCTFIELD with ACCESS_TIMING surround every parameter set with
parentheses: "(P2Min P2Max P3Min P3Max P4Min TimingSet)(...)"

Parameters
name Name of the communication parameter.
value New communication parameter value.

8.3.2.10 void setUniqueRespIdTable ( int uniqueRespIdentifier, std::string name, int value )

Set a communication parameter from an UniqueRespIdTable.

8.3 Link Class Reference 25


Parameters
uniqueResp←- UniqueRespIdTable page identifier.
Identifier
name Name of the communication parameter.
value New communication parameter value.

8.3.2.11 void setUniqueRespIdTable ( std::string uniqueRespIdentifier, std::string name, std::string value )

Set a communication parameter from an UniqueRespIdTable.


Parameters
uniqueResp←- UniqueRespIdTable page identifier.
Identifier
name Name of the communication parameter.
value New communication parameter value.

8.3.2.12 Cop startCop ( COP_TYPE copType, int sendCounter, int receiveCounter, std::vector< unsigned char >
dataBytes )

Start a Cop for sending and receiving data.


Parameters
copType Type of the Cop to be started.
sendCounter Determines how often the Cop will be sent. 0 = receive only, -1 = cyclic sending
receiveCounter Determines how many responses we are waiting for. 0 = send only, -1 = receive infinite
dataBytes Data bytes to be sent.

Returns

Cop object.

Examples:

example_1.cpp.

8.3.2.13 Cop startCop ( COP_TYPE copType, int sendCounter, int receiveCounter, std::string byteString )

Start a Cop for sending and receiving data.


Parameters
copType Type of the Cop to be started.
sendCounter Determines how often the Cop will be sent. 0 = receive only, -1 = cyclic sending
receiveCounter Determines how many responses we are waiting for. 0 = send only, -1 = receive infinite
byteString String with space seperated data bytes. PDU bytes are always interpreted as hex.

Returns

Cop object.

8.3 Link Class Reference 26


8.4 Pduapi Class Reference

Class for convenient D-PDU API access.

Public Member Functions

• Vci connectVci ()
Open connection to the first Vci found. This is only useful if you have just one Vci.
• Vci connectVci (VCITYPE vciType)
Open connection to a Vci of the specified VCITYPE.
• Vci connectVci (std::string vciName)
Open connection to a Vci device.
• std::vector< std::string > getVciList ()
Get a list of all VCIs that are currently available.

Static Public Member Functions

• static Pduapi construct ()


Construct a Pduapi object from the D-PDU API with the highest version number found in the Root-XML file. Prefers
Softing PK versions.
• static Pduapi construct (std::string pduapiName)
Construct a Pduapi object from a installed D-PDU API with the specified name.
• static std::vector< std::string > getPduapiList ()
Get a list of available D-PDU APIs.
• static std::string getEnumString (T_PDU_ERROR value)
Get an EasyPDU enum value as string.
• static std::string getEnumString (T_PDU_ERR_EVT value)
Get an EasyPDU enum value as string.
• static std::string getEnumString (T_PDU_STATUS value)
Get an EasyPDU enum value as string.

8.4.1 Detailed Description

Class for convenient D-PDU API access.

EasyPDU Pduapi Vci Link Cop Response

Examples:

example_1.cpp.

8.4 Pduapi Class Reference 27


8.4.2 Member Function Documentation

8.4.2.1 Vci connectVci ( )

Open connection to the first Vci found. This is only useful if you have just one Vci.

Returns

Vci object connected to.

Examples:

example_1.cpp.

8.4.2.2 Vci connectVci ( VCITYPE vciType )

Open connection to a Vci of the specified VCITYPE.


Parameters
vciType Type of the VCI.

Returns

Vci object connected to.

8.4.2.3 Vci connectVci ( std::string vciName )

Open connection to a Vci device.


Parameters
vciName Name of a VCI obtained from getVciList() or just the VCI type.

Returns

Vci object connected to.

8.4.2.4 static Pduapi construct ( ) [static]

Construct a Pduapi object from the D-PDU API with the highest version number found in the Root-XML file. Prefers
Softing PK versions.
Perfer PK version.

Returns

Pduapi object.

8.4.2.5 static Pduapi construct ( std::string pduapiName ) [static]

Construct a Pduapi object from a installed D-PDU API with the specified name.
Examples: EDIC_D_PDU_API_11_22_001 for Softing D-PDU API, D_PDU_API_SAMTEC for samtec PDUAPI.

8.4 Pduapi Class Reference 28


Parameters
pduapiName Name of the D-PDU API as obtained from getPduapiList().

Returns

Pduapi object.

8.4.2.6 static std::string getEnumString ( T_PDU_ERROR value ) [static]

Get an EasyPDU enum value as string.


This function can be used for exampel for printing enum error codes.
Parameters
value Enum value to be converted.

Returns

String representation of enum value."

8.4.2.7 static std::string getEnumString ( T_PDU_ERR_EVT value ) [static]

Get an EasyPDU enum value as string.


This function can be used for exampel for printing enum error codes.
Parameters
value Enum value to be converted.

Returns

String representation of enum value."

8.4.2.8 static std::string getEnumString ( T_PDU_STATUS value ) [static]

Get an EasyPDU enum value as string.


This function can be used for exampel for printing enum error codes.
Parameters
value Enum value to be converted.

Returns

String representation of enum value."

8.4.2.9 static std::vector<std::string> getPduapiList ( ) [static]

Get a list of available D-PDU APIs.


Only Softing and Samtec D-PDU APIs are supported.

8.4 Pduapi Class Reference 29


8.4.2.10 std::vector<std::string> getVciList ( )

Get a list of all VCIs that are currently available.

Returns

List of VCI names.

8.5 Response Class Reference

Class for convenient Cop-Response access.

Public Member Functions

• std::vector< unsigned char > getData ()


Get response data as byte vector.
• std::string getDataAsHexString ()
Get response data as hexadecimal string.
• std::string getErrorMessage ()
Get error message if Response is an error-response.
• T_PDU_ERR_EVT getErrorCode ()
Get original D-PDU API event error code.
• int getUniqueRespIdentifier ()
Get the UniqueRespIdentifier the response belongs to.
• bool isError ()
Indicates if this Response is an error-response.
• operator bool ()
Evaluates true if this is a valid response object.

8.5.1 Detailed Description

Class for convenient Cop-Response access.

EasyPDU Pduapi Vci Link Cop Response

Examples:

example_1.cpp.

8.5 Response Class Reference 30


8.5.2 Member Function Documentation

8.5.2.1 std::vector<unsigned char> getData ( )

Get response data as byte vector.

Returns

Byte vector.

8.5.2.2 std::string getDataAsHexString ( )

Get response data as hexadecimal string.

Returns

String of blank seperated hex values.

8.5.2.3 T_PDU_ERR_EVT getErrorCode ( )

Get original D-PDU API event error code.

Returns

Event error code as enum.

8.5.2.4 std::string getErrorMessage ( )

Get error message if Response is an error-response.

Returns

Error message string.

8.5.2.5 int getUniqueRespIdentifier ( )

Get the UniqueRespIdentifier the response belongs to.

Returns

Identifier as defined with Link.setUniqueRespIdTable().

8.5.2.6 bool isError ( )

Indicates if this Response is an error-response.

Returns

true, if error response; false if data response.

8.5.2.7 operator bool ( )

Evaluates true if this is a valid response object.

8.5 Response Class Reference 31


8.6 Vci Class Reference

Class for convenient VCI hardware device access.

Public Member Functions

• Link openLink (PROTOCOL protocol, BUSTYPE bustype, PORT port)


Open a logical link to a specified vehicle bus.
• Link openLink (std::string protocol, std::string bustype, std::string port)
Open a logical link to a specified vehicle bus.
• void startBustrace (BUSTYPE bustype, PORT port, std::string path, std::string filename)
Trace all data packages visible on the physical bus to file.
• void startBustrace (std::string bustype, std::string port, std::string path, std::string filename)
Trace all data packages visible on the physical bus to file.
• void stopBustrace (BUSTYPE bustype, PORT port)
Stop bustrace for a specified bus.
• void stopBustrace (std::string bustype, std::string port)
Stop bustrace for a specified bus.

8.6.1 Detailed Description

Class for convenient VCI hardware device access.

EasyPDU Pduapi Vci Link Cop Response

Examples:

example_1.cpp.

8.6.2 Member Function Documentation

8.6.2.1 Link openLink ( PROTOCOL protocol, BUSTYPE bustype, PORT port )

Open a logical link to a specified vehicle bus.


Parameters
protocol Protocol (UDSCAN, DiagCAN, KWP2000GV,...)

8.6 Vci Class Reference 32


bustype Bustype (ISO_11898_2_DWCAN, ISO_11898_3_DWFTCAN, ISO_9141_2_UART)
port Port on the VCI (CAN1, CAN2, K_LINE, KL_LINE)

Returns

Link object.

Examples:

example_1.cpp.

8.6.2.2 Link openLink ( std::string protocol, std::string bustype, std::string port )

Open a logical link to a specified vehicle bus.


Parameters
protocol Protocol (UDSCAN, DiagCAN, KWP2000GV,...)
bustype Bustype (ISO_11898_2_DWCAN, ISO_11898_3_DWFTCAN, ISO_9141_2_UART)
port Port on the VCI (CAN1, CAN2, K_LINE, KL_LINE)

Returns

Link object.

8.6.2.3 void startBustrace ( BUSTYPE bustype, PORT port, std::string path, std::string filename )

Trace all data packages visible on the physical bus to file.


This feature is only supported by Softing D-PDU APIs.
Parameters
bustype Type of bus to be traced.
port Port to be traced.
path Trace file path. Use "" for default path.
filename Filename for the trace file. Use "" for default filename.

8.6.2.4 void startBustrace ( std::string bustype, std::string port, std::string path, std::string filename )

Trace all data packages visible on the physical bus to file.


This feature is only supported by Softing D-PDU APIs.
Parameters
bustype Type of bus to be traced.
port Port to be traced.
path Trace file path. Use "" for default path.
filename Filename for the trace file. Use "" for default filename.

8.6.2.5 void stopBustrace ( BUSTYPE bustype, PORT port )

Stop bustrace for a specified bus.

8.6 Vci Class Reference 33


Parameters
bustype Type of bus to be traced.
port Port to be traced.

8.6.2.6 void stopBustrace ( std::string bustype, std::string port )

Stop bustrace for a specified bus.


Parameters
bustype Type of bus to be traced.
port Port to be traced.

9 Example Documentation

9.1 ComParam.ini
1 ;here you can set your ComParams
2 ;you can set decimal or hexadecimal values
3 ;for hexadecimal values use the prefix 0x
4 ;you can add / delete parameters depending on the protocol used
5
6 [ISO_15765_3_on_ISO_15765_2]
7 CP_P2Max=100000
8 CP_RequestAddrMode=0x2
9 CP_CanFuncReqId=0x641
10 CP_CanFuncReqFormat=0x5
11
12
13 ;here you can set your UniqueRespIdTable parameters
14 ;the first value is the page number
15 ;if no UniqueRespIdTable is defined, all responses are received
16 ;you can add / delete parameters depending on the protocol used
17 ;ComParam sections for a UniqueRespIdTable always start with "URID_"
18 ;after the protocol name you have to assign the UniqueRespId
19
20 [URID_ISO_15765_3_on_ISO_15765_2=1]
21 ;CP_CanPhysReqId=0x642
22 ;CP_CanPhysReqFormat=0x5
23 ;CP_CanRespUSDTId=0x682
24 ;CP_CanRespUSDTFormat=0x5

9.2 example_1.cpp
/***********************************************************************************************
* This is a simple example for using the EasyPDU API with C++.
***********************************************************************************************
* Softing AG Richard-Reitzner-Allee 6 D-85540 Haar, Germany
* Projekt EasyPDU http://www.softing.com
***********************************************************************************************
*
* This example file shows how to work with the EasyPDUCpp API.
* Make sure, you have added the EasyPDUCpp.dll/EasyPDUCpp.lib to your project.
* If you want to use IntelliSense for easy code completion make sure that the EasyPDUCpp.xml file is in
the same folder as the EasyPDUCpp.dll file.
*
* This sequential program will try communicate with an ECU on the CAN bus.
*
* IMPORTANT: Depending on your bus structure an ECU you must adapt the ComParam and UniqueRespIdTable
settings!
*
* The steps are:
* - load the D-PDU API
* - connect the VCI

9 Example Documentation 34
* - open a Link to the CAN bus
* - set a few ComParams
* - set the UniqueRespIdTable
* - update the ComParams and UniqueRespIdTable settings
* - send a request to the ECU and receive the answer
* - print the received data bytes
* - close all open ressources
* - wait for key to exit
*
* If something is going wrong, a detailed Exception will be thrown. It is up to you to handle it.
*/

#include <vector>
#include <string>
#include <iostream>
#include "EasyPDUCpp.h"

using namespace std;


using namespace EasyPDU;

int main()
{
try
{
// construct D-PDU API
Pduapi pduapi = Pduapi::construct();
cout << "Pduapi constructed" << endl;

// connect Vci
Vci vci = pduapi.connectVci();
cout << "Vci connected" << endl;

// open Link
Link link = vci.openLink(ISO_15765_3_on_ISO_15765_2,
ISO_11898_2_DWCAN,CAN1);
cout << "Link opened" << endl;

/*
// way 1: set ComParams and UniqueRespId directly
link.setComParam("CP_P2Max", 100000);
link.setComParam("CP_RequestAddrMode", 0x1);
link.setComParam("CP_CanFuncReqId", 0x18DB33F1);
link.setComParam("CP_CanFuncReqFormat", 0x7);
link.setUniqueRespIdTable(1, "CP_CanPhysReqId", 0x18DA10F1);
link.setUniqueRespIdTable(1, "CP_CanPhysReqFormat", 0x7);
link.setUniqueRespIdTable(1, "CP_CanRespUSDTId", 0x18DAF110);
link.setUniqueRespIdTable(1, "CP_CanRespUSDTFormat", 0x7);
*/

// way 2: read ComParams and UniqueRespIdTable from file


link.readAndSetParamsFromFile("ComParam.ini");

// connect Link
link.connect();
cout << "Link connected" << endl;

// start Cop
Cop cop = link.startCop(SENDRECV, 1, 2, "10 92");
cout << "Cop started" << endl << endl;

// get response(s)
while (Response response = cop.getResponse())
{
if(response.isError())
{
cout << "Response error code: " << Pduapi::getEnumString(response.getErrorCode()) << endl;
cout << "Response error message: " << response.getErrorMessage() << endl << endl;
}
else
{
cout << "Response data: " << response.getDataAsHexString() << endl << endl;
}
}
}
catch(EasyPduException e)
{
cout << endl << "------------------------------------------------" << endl;
cout << e.what();
cout << endl << "------------------------------------------------" << endl;

9.2 example_1.cpp 35
}

// wait for key to exit


cout << endl << "<<<---PRESS ENTER TO EXIT--->>>" << endl;
cin.clear();
cin.ignore(cin.rdbuf()->in_avail());
cin.get();
return 0;
}

9.3 example_1.cs
/***********************************************************************************************
* This is a simple example for using the EasyPDU API with C#.
***********************************************************************************************
* Softing AG Richard-Reitzner-Allee 6 D-85540 Haar, Germany
* Projekt EasyPDU http://www.softing.com
***********************************************************************************************
*
* This example file shows how to work with the EasyPDUdotNET API.
* Make sure, you have added the EasyPDUdotNET.dll to your project.
* If you want to use IntelliSense for easy code completion make sure that the EasyPDUdotNET.xml file is in
the same folder as the EasyPDUdotNET.dll file.
*
* This sequential program will try communicate with an ECU on the CAN bus.
*
* IMPORTANT: Depending on your bus structure an ECU you must adapt the ComParam and UniqueRespIdTable
settings!
*
* The steps are:
* - load the D-PDU API
* - connect the VCI
* - open a Link to the CAN bus
* - set a few ComParams
* - set the UniqueRespIdTable
* - update the ComParams and UniqueRespIdTable settings
* - send a request to the ECU and receive the answer
* - print the received data bytes
* - close all open ressources
* - wait for key to exit
*
* If something is going wrong, a detailed Exception will be thrown. It is up to you to handle it.
*/

using System;
using EasyPDU;

class EXAMPLE_1
{
static void Main(string[] args)
{
try
{
// Load D-PDU API
Console.WriteLine("Load D-PDU API...");
using (Pduapi pduapi = Pduapi.construct())
{
// Connect VCI
Console.WriteLine("Connect VCI...");
using (Vci vci = pduapi.connectVci())
{
// Open Link
Console.WriteLine("Open Link...");
using (Link link = vci.openLink(PROTOCOL.ISO_15765_3_on_ISO_15765_2,
BUSTYPE.ISO_11898_2_DWCAN, PORT.CAN1))
{
// Set ComParams for physical addressing
Console.WriteLine("Set ComParams for physical addressing...");
link.setComParam("CP_RequestAddrMode", 0x1); // 0x1 = physical, 0x2 = functional

// Set UniqueRespIdTable for physical addressing


Console.WriteLine("Set UniqueRespIdTable for physical addressing...");
link.setUniqueRespIdTable(1, "CP_CanPhysReqId", 0x641);
link.setUniqueRespIdTable(1, "CP_CanRespUSDTId", 0x681);

// Connect Link

9.3 example_1.cs 36
Console.WriteLine("Connect Link...");
link.connect();

// Send data
Console.WriteLine("Send data...");
using (Cop cop = link.startCop(COP_TYPE.STARTCOMM, 1, -2, new byte[] { 0x10, 0x92
}))
{
// Print received data
Console.WriteLine("Print received data:");
while (true)
{
using (Response response = cop.getResponse())
{
if (response == null)
break;
if (response.isError())
Console.WriteLine(" Error: " + response.getErrorMessage());
else
Console.WriteLine(" RespId(" + response.getUniqueRespIdentifier() + "): " +
response.getDataAsHexString());
}
}
}
}
}
}
}
catch (EasyPduException e)
{
Console.WriteLine(e.Message);
}

// Wait for key to exit


Console.WriteLine("\n<<<---PRESS ENTER KEY TO EXIT--->>>");
Console.ReadKey();
}
}

9.4 example_1.py
1 ###############################################################################################
2 # This is a simple example for using the EasyPDU API with Python 2.7 32 bit.
3 # Important: The EasyPDU is currently not working with Python 3 or any 64 bit Python.
4 ###############################################################################################
5 # Softing AG Richard-Reitzner-Allee 6 D-85540 Haar, Germany
6 # Projekt EasyPDU http://www.softing.com
7 ###############################################################################################
8
9 from EasyPDUPython import *
10
11 print "construct PDUAPI"
12 with Pduapi.construct() as pduapi:
13 print "connect VCI"
14 with pduapi.connectVci("EDICusb") as vci:
15 print "open logical link"
16 with vci.openLink(PROTOCOL.ISO_15765_3_on_ISO_15765_2, BUSTYPE.ISO_11898_2_DWCAN, PORT.CAN1) as link:
17 print "set communication parameters"
18 link.setComParam("CP_P2Max", 10000)
19 link.setComParam("CP_RequestAddrMode", 0x2)
20 link.setComParam("CP_CanFuncReqId", 0x18DB33F1)
21 link.setComParam("CP_CanFuncReqFormat", 0x7)
22 print "set unique response id table"
23 link.setUniqueRespIdTable(1, "CP_CanPhysReqId", 0x18DA10F1)
24 link.setUniqueRespIdTable(1, "CP_CanPhysReqFormat", 0x7)
25 link.setUniqueRespIdTable(1, "CP_CanRespUSDTId", 0x18DAF110)
26 link.setUniqueRespIdTable(1, "CP_CanRespUSDTFormat", 0x7)
27 print "connect link"
28 link.connect()
29 print "start cop"
30 with link.startCop(COP_TYPE.SENDRECV, 1, -2, [0x10, 0x92]) as cop:
31 print "get cop response"
32 while True:
33 response = cop.getResponse()
34 if not response: break
35 if response.isError():

9.4 example_1.py 37
36 print response.getErrorMessage()
37 else:
38 print response.getDataAsHexString()
39 del response
40
41 raw_input("PRESS ENTER TO EXIT...")

9.5 example_2.cs
/***********************************************************************************************
* This is a simple example for using the EasyPDU API with C#.
***********************************************************************************************
* Softing AG Richard-Reitzner-Allee 6 D-85540 Haar, Germany
* Projekt EasyPDU http://www.softing.com
***********************************************************************************************
*
* This example file shows how to work with the EasyPDUdotNET API.
* Make sure, you have added the EasyPDUdotNET.dll to your project.
* If you want to use IntelliSense for easy code completion make sure that the EasyPDUdotNET.xml file is in
the same folder as the EasyPDUdotNET.dll file.
*
* This program will start two thread:
* Thread 1 will receive data from the CAN_RAW bus.
* Thread 2 will send data to the CAN_RAW bus.
*
*
* IMPORTANT 1: Depending on your bus structure an ECU you must adapt the ComParam and UniqueRespIdTable
settings!
* IMPORTANT 2: If the ECU does not response, the receive thread will wait infinite!
*
* The steps are:
* - load the D-PDU API
* - connect the VCI
* - open a Link to the CAN bus
* - set the UniqueRespIdTable
* - update UniqueRespIdTable settings
* - start Thread1
* - start ReceiveOnly ComPrimitive
* - wait until Thread2 has started sending ComPrimitive
* - received 10 responses data
* - start Thread2
* - wait until Thread1 has started ReceiveOnly ComPrimitive
* - start 2 ComPrimiteve with sendCounter=5 (2 * 5 = 10)
* - wait until Thread1 and Thread2 have finished
* - wait for key to exit
*
* If something is going wrong, a detailed Exception will be thrown. It is up to you to handle it.
*/

using System;
using System.Threading;
using EasyPDU;

class EXAMPLE_2
{
static void Main(string[] args)
{
try
{
// Load D-PDU API
Console.WriteLine("MainThread: Load D-PDU API...");
using (Pduapi pduapi = Pduapi.construct())
{
// Connect VCI
Console.WriteLine("MainThread: Connect VCI...");
using (Vci vci = pduapi.connectVci())
{

// Open Link
Console.WriteLine("MainThread: Open Link...");
using (Link link = vci.openLink(PROTOCOL.ISO_15765_3_on_ISO_15765_2,
BUSTYPE.ISO_11898_2_DWCAN, PORT.CAN1))
{

// Read ComParams and UniqueRespIdTable from file


Console.WriteLine("MainThread: Read ComParams and UniqueRespIdTable from file...");

9.5 example_2.cs 38
link.readAndSetParamsFromFile("ComParam.ini");

// Connect Link
Console.WriteLine("MainThread: Connect Link...");
link.connect();

// Start send and receive thread


Console.WriteLine("MainThread: Start send and receive thread.");
Thread receiveThread = new Thread(ReceiveThreadFunction);
Thread sendThread = new Thread(SendThreadFunction);
receiveThread.Start(link);
Thread.Sleep(1000);
sendThread.Start(link);

// Wait until threads have finished


receiveThread.Join();
sendThread.Join();

// Close all open resources


Console.WriteLine("MainThread: Close all open resources...");
}
}
}
}
catch (EasyPduException e)
{
Console.WriteLine(e.Message);
}
// Wait for key to exit
Console.WriteLine("\n<<<---PRESS ENTER TO EXIT--->>>");
Console.ReadKey();
}

public static void ReceiveThreadFunction(object link)


{
// Start receiving ComPrimitive...
Console.WriteLine("ReceiveThread: Start receiving ComPrimitive.");
using (Cop receiveCop = ((Link)link).startCop(COP_TYPE.SENDRECV, 0, -1, new byte[] { }))
{
Console.WriteLine("ReceiveThread: Receiving ComPrimitive started.");

// Poll for responses


Console.WriteLine("ReceiveThread: Poll for responses...");
for (int i = 0; i < 10; i++)
{
using (Response response = receiveCop.getResponse())
{
if (response == null)
break;
if (response.isError())
Console.WriteLine("ReceiveThread: Error: " + response.getErrorMessage());
else
Console.WriteLine("ReceiveThread: RespId(" + response.getUniqueRespIdentifier() + "): " +
response.getDataAsHexString());
}
}

// Stop ComPrimitive
Console.WriteLine("ReceiveThread: Stop receiving ComPrimitive...");
}
}

public static void SendThreadFunction(object link)


{
// Start sending ComPrimitive...
Console.WriteLine("SendThread: Start sending ComPrimitive.");
Cop sendCop1 = ((Link)link).startCop(COP_TYPE.SENDRECV, 5, 0, new byte[] { 0x10, 0x92 });
Cop sendCop2 = ((Link)link).startCop(COP_TYPE.SENDRECV, 5, 0, new byte[] { 0x10, 0x92 });
sendCop1.waitUntilFinished();
sendCop2.waitUntilFinished();
Console.WriteLine("SendThread: Sending ComPrimitive started.");
}
}

9.5 example_2.cs 39
Index
CAN1 MSP_VW2000LP_on_ISO_14230_2, 18
EasyPDU, 17 MSP_VW2000LP_on_TP16, 18
CAN2 MSP_VW2000LP_on_TP20, 18
EasyPDU, 17 PDU_CLLST_COMM_STARTED, 20
Cop, 20 PDU_CLLST_OFFLINE, 20
PDU_CLLST_ONLINE, 20
EDICblue PDU_COPST_CANCELLED, 20
EasyPDU, 20 PDU_COPST_EXECUTING, 19
EDICcard2 PDU_COPST_FINISHED, 20
EasyPDU, 20 PDU_COPST_IDLE, 19
EDICpci PDU_COPST_WAITING, 20
EasyPDU, 20 PDU_ERR_API_SW_OUT_OF_DATE, 19
EDICusb PDU_ERR_CABLE_UNKNOWN, 19
EasyPDU, 20 PDU_ERR_CLL_CONNECTED, 19
EDICwlan PDU_ERR_CLL_NOT_CONNECTED, 19
EasyPDU, 20 PDU_ERR_CLL_NOT_STARTED, 19
EasyPDU PDU_ERR_COMM_PC_TO_VCI_FAILED, 18
CAN1, 17 PDU_ERR_COMPARAM_LOCKED, 19
CAN2, 17 PDU_ERR_COMPARAM_NOT_SUPPORTED, 19
EDICblue, 20 PDU_ERR_EVENT_QUEUE_EMPTY, 19
EDICcard2, 20 PDU_ERR_EVT_FRAME_STRUCT, 18
EDICpci, 20 PDU_ERR_EVT_INIT_ERROR, 18
EDICusb, 20 PDU_ERR_EVT_LOST_COMM_TO_VCI, 18
EDICwlan, 20 PDU_ERR_EVT_NOERROR, 18
ISO_11898_2_DWCAN, 16 PDU_ERR_EVT_PROT_ERR, 18
ISO_11898_3_DWFTCAN, 16 PDU_ERR_EVT_RSC_LOCKED, 18
ISO_11898_RAW, 17 PDU_ERR_EVT_RX_ERROR, 18
ISO_14230_1_UART, 16 PDU_ERR_EVT_RX_TIMEOUT, 18
ISO_14230_3_on_ISO_14230_2, 17 PDU_ERR_EVT_TESTER_PRESENT_ERROR,
ISO_14230_3_on_ISO_15765_2, 17 18
ISO_15031_5_on_ISO_14230_4, 17 PDU_ERR_EVT_TX_ERROR, 18
ISO_15031_5_on_ISO_15765_4, 17 PDU_ERR_EVT_VCI_HARDWARE_FAULT, 18
ISO_15031_5_on_ISO_9141_2, 17 PDU_ERR_FCT_FAILED, 18
ISO_15765_3_on_ISO_15765_2, 17 PDU_ERR_ID_NOT_SUPPORTED, 19
ISO_9141_2_UART, 16 PDU_ERR_INVALID_HANDLE, 19
ISO_OBD_on_ISO_15765_4, 17 PDU_ERR_INVALID_PARAMETERS, 19
ISO_OBD_on_K_Line, 17 PDU_ERR_MODULE_FW_OUT_OF_DATE, 19
K_LINE, 17 PDU_ERR_MODULE_NOT_CONNECTED, 19
KL_LINE, 17 PDU_ERR_MUX_RSC_NOT_SUPPORTED, 19
KW500_1_UART, 16 PDU_ERR_NO_CABLE_DETECTED, 19
L_LINE, 17 PDU_ERR_PDUAPI_NOT_CONSTRUCTED, 18
MOST, 16 PDU_ERR_PIN_NOT_CONNECTED, 19
MOST_PORT, 17 PDU_ERR_RESERVED_1, 18
MSP_KW1281_on_ISO_9141_2, 17 PDU_ERR_RESOURCE_BUSY, 18
MSP_KW1281_on_TP16, 17 PDU_ERR_RESOURCE_ERROR, 19
MSP_KW500_3_on_KW500_2, 17 PDU_ERR_RESOURCE_TABLE_CHANGED, 18
MSP_KW71_UART, 17 PDU_ERR_RSC_LOCKED, 19
MSP_MOST_14229_on_MOST_DAP, 17 PDU_ERR_RSC_LOCKED_BY_OTHER_CLL, 19
MSP_SFTNG_CAN, 17 PDU_ERR_RSC_NOT_LOCKED, 19
MSP_SFTNG_ISO_11898_onboard, 17 PDU_ERR_SHARING_VIOLATION, 18
PDU_ERR_TEMPPARAM_NOT_ALLOWED, 19 EasyPDU, 16
PDU_ERR_TX_QUEUE_FULL, 19
PDU_ERR_VALUE_NOT_SUPPORTED, 19 L_LINE
PDU_ERR_VOLTAGE_NOT_SUPPORTED, 19 EasyPDU, 17
PDU_MODST_AVAIL, 20 Link, 23
PDU_MODST_NOT_AVAIL, 20
PDU_MODST_NOT_READY, 20 MOST
PDU_MODST_READY, 20 EasyPDU, 16
PDU_STATUS_NOERROR, 18 MOST_PORT
SAE_J1939_11_DWCAN, 16 EasyPDU, 17
SAE_J1939_73_on_SAE_J1939_21, 18 MSP_KW1281_on_ISO_9141_2
SENDRECV, 17 EasyPDU, 17
STARTCOMM, 17 MSP_KW1281_on_TP16
STOPCOMM, 17 EasyPDU, 17
UPDATEPARAM, 17 MSP_KW500_3_on_KW500_2
VCI_HS_LIGHT, 20 EasyPDU, 17
VCI_HS_PLUS, 20 MSP_KW71_UART
VCI_HS_WLAN_HD, 20 EasyPDU, 17
VCI_HSC, 20 MSP_MOST_14229_on_MOST_DAP
VCI_HSX, 20 EasyPDU, 17
MSP_SFTNG_CAN
ISO_11898_2_DWCAN EasyPDU, 17
EasyPDU, 16 MSP_SFTNG_ISO_11898_onboard
ISO_11898_3_DWFTCAN EasyPDU, 17
EasyPDU, 16 MSP_VW2000LP_on_ISO_14230_2
ISO_11898_RAW EasyPDU, 18
EasyPDU, 17 MSP_VW2000LP_on_TP16
ISO_14230_1_UART EasyPDU, 18
EasyPDU, 16 MSP_VW2000LP_on_TP20
ISO_14230_3_on_ISO_14230_2 EasyPDU, 18
EasyPDU, 17
ISO_14230_3_on_ISO_15765_2 PDU_CLLST_COMM_STARTED
EasyPDU, 17 EasyPDU, 20
ISO_15031_5_on_ISO_14230_4 PDU_CLLST_OFFLINE
EasyPDU, 17 EasyPDU, 20
ISO_15031_5_on_ISO_15765_4 PDU_CLLST_ONLINE
EasyPDU, 17 EasyPDU, 20
ISO_15031_5_on_ISO_9141_2 PDU_COPST_CANCELLED
EasyPDU, 17 EasyPDU, 20
ISO_15765_3_on_ISO_15765_2 PDU_COPST_EXECUTING
EasyPDU, 17 EasyPDU, 19
ISO_9141_2_UART PDU_COPST_FINISHED
EasyPDU, 16 EasyPDU, 20
ISO_OBD_on_ISO_15765_4 PDU_COPST_IDLE
EasyPDU, 17 EasyPDU, 19
ISO_OBD_on_K_Line PDU_COPST_WAITING
EasyPDU, 17 EasyPDU, 20
PDU_ERR_API_SW_OUT_OF_DATE
K_LINE EasyPDU, 19
EasyPDU, 17 PDU_ERR_CABLE_UNKNOWN
KL_LINE EasyPDU, 19
EasyPDU, 17 PDU_ERR_CLL_CONNECTED
KW500_1_UART EasyPDU, 19

INDEX 41
PDU_ERR_CLL_NOT_CONNECTED EasyPDU, 19
EasyPDU, 19 PDU_ERR_RESERVED_1
PDU_ERR_CLL_NOT_STARTED EasyPDU, 18
EasyPDU, 19 PDU_ERR_RESOURCE_BUSY
PDU_ERR_COMM_PC_TO_VCI_FAILED EasyPDU, 18
EasyPDU, 18 PDU_ERR_RESOURCE_ERROR
PDU_ERR_COMPARAM_LOCKED EasyPDU, 19
EasyPDU, 19 PDU_ERR_RESOURCE_TABLE_CHANGED
PDU_ERR_COMPARAM_NOT_SUPPORTED EasyPDU, 18
EasyPDU, 19 PDU_ERR_RSC_LOCKED
PDU_ERR_EVENT_QUEUE_EMPTY EasyPDU, 19
EasyPDU, 19 PDU_ERR_RSC_LOCKED_BY_OTHER_CLL
PDU_ERR_EVT_FRAME_STRUCT EasyPDU, 19
EasyPDU, 18 PDU_ERR_RSC_NOT_LOCKED
PDU_ERR_EVT_INIT_ERROR EasyPDU, 19
EasyPDU, 18 PDU_ERR_SHARING_VIOLATION
PDU_ERR_EVT_LOST_COMM_TO_VCI EasyPDU, 18
EasyPDU, 18 PDU_ERR_TEMPPARAM_NOT_ALLOWED
PDU_ERR_EVT_NOERROR EasyPDU, 19
EasyPDU, 18 PDU_ERR_TX_QUEUE_FULL
PDU_ERR_EVT_PROT_ERR EasyPDU, 19
EasyPDU, 18 PDU_ERR_VALUE_NOT_SUPPORTED
PDU_ERR_EVT_RSC_LOCKED EasyPDU, 19
EasyPDU, 18 PDU_ERR_VOLTAGE_NOT_SUPPORTED
PDU_ERR_EVT_RX_ERROR EasyPDU, 19
EasyPDU, 18 PDU_MODST_AVAIL
PDU_ERR_EVT_RX_TIMEOUT EasyPDU, 20
EasyPDU, 18 PDU_MODST_NOT_AVAIL
PDU_ERR_EVT_TESTER_PRESENT_ERROR EasyPDU, 20
EasyPDU, 18 PDU_MODST_NOT_READY
PDU_ERR_EVT_TX_ERROR EasyPDU, 20
EasyPDU, 18 PDU_MODST_READY
PDU_ERR_EVT_VCI_HARDWARE_FAULT EasyPDU, 20
EasyPDU, 18 PDU_STATUS_NOERROR
PDU_ERR_FCT_FAILED EasyPDU, 18
EasyPDU, 18 Pduapi, 27
PDU_ERR_ID_NOT_SUPPORTED
EasyPDU, 19 Response, 30
PDU_ERR_INVALID_HANDLE
SAE_J1939_11_DWCAN
EasyPDU, 19
EasyPDU, 16
PDU_ERR_INVALID_PARAMETERS
SAE_J1939_73_on_SAE_J1939_21
EasyPDU, 19
EasyPDU, 18
PDU_ERR_MODULE_FW_OUT_OF_DATE
SENDRECV
EasyPDU, 19
EasyPDU, 17
PDU_ERR_MODULE_NOT_CONNECTED
STARTCOMM
EasyPDU, 19
EasyPDU, 17
PDU_ERR_MUX_RSC_NOT_SUPPORTED
STOPCOMM
EasyPDU, 19
EasyPDU, 17
PDU_ERR_NO_CABLE_DETECTED
EasyPDU, 19 UPDATEPARAM
PDU_ERR_PDUAPI_NOT_CONSTRUCTED EasyPDU, 17
EasyPDU, 18
PDU_ERR_PIN_NOT_CONNECTED VCI_HS_LIGHT

INDEX 42
EasyPDU, 20
VCI_HS_PLUS
EasyPDU, 20
VCI_HS_WLAN_HD
EasyPDU, 20
VCI_HSC
EasyPDU, 20
VCI_HSX
EasyPDU, 20
Vci, 32

INDEX 43

You might also like