Automotive Diagnostic Command Set Toolkit Help

Edition Date: November 2018

Part Number: 372140J-01

»View Product Info
Download Help (Windows Only)


Opens a diagnostic session on an IP port. Communication to the ECU is not yet started.


long ndOpenDiagnosticOnIPVersion(
     LVBoolean *dynamicPort,
     uint8_t DoIPProtocolVersion,
     TD1 *DiagRefOut);


protocol version

Defines the protocol version of the DoIP packets:

12010 — Initial draft version DoIP ISO/DIS 13400:2:2010
22012 — Official released version DoIP ISO 13400-2:2012

If protocol version is set to 2010, the protocol version byte of the Generic DoIP header is set to 1. If protocol version is set to 2012, the protocol version byte of the Generic DoIP header is set to 2. The default is 2010.

The protocol versions used by the ECU and Automotive Diagnostic Command Set applications must match or a Generic Header error will be issued.


Defines whether the standard UDP port 13401 (UDP_TEST_EQUIPMENT_LISTEN) is used for communication (FALSE) or a dynamically assigned UDP port (UDP_TEST_EQUIPMENT_REQUEST) is opened (TRUE).



A struct that contains all necessary information about the diagnostic session. Pass this struct as a handle to all subsequent diagnostic functions and close it using ndCloseDiagnostic.

Return Value

The return value indicates the function call status as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.

Use the ndStatusToString function to obtain a descriptive string for the return value.


ndOpenDiagnosticOnIPVersion opens a Diagnostic on Internet Protocol (DoIP) communication channel to an ECU. The UDP port specified as input is initialized, and a handle to it is stored (among other internal data) in diagRefOut, which serves as reference for further diagnostic functions.

Note that no communication to an ECU takes place at this point. To open a diagnostic session on an ECU, call ndDoIPGetEntities to find out which DoIP entities (DoIP-capable ECUs) exist in the network. You need to create a TCP/IP connection to the selected DoIP entity using ndDoIPConnect. After that, you can execute diagnostic services on the TCP/IP connection.

This function replaces the standard (CAN-based) ndOpenDiagnosticOnCANFD, because the CAN parameters are no longer relevant for IP-based diagnostics.

In general, it is not necessary to manipulate the diagRefOut cluster contents.


Not Helpful