Open Diagnostic on IP.vi
- Updated2025-10-07
- 5 minute(s) read
Purpose
Opens a diagnostic session on an IP port. Communication to the ECU is not yet started. Format
Input
|
protocol version is the protocol version of the DoIP packets:
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. |
||||||
|
dynamic port defines whether a dynamically assigned UDP source port is used (TRUE, default). If set to FALSE, the port set as local static port will be used. | ||||||
|
local static port defines the source UDP port to use when dynamic port is set to FALSE. Default is 13401. | ||||||
|
XNET IP stack name specifies the name of the XNET IP Stack to use for IP communication by this diagnostic session. This IP stack must be started beforehand, refer to NI-XNET Hardware and Software Help for information about creating and configuring an XNET IP Stack. You can wire the XNET IP Stack reference directly to this input. This VI will wait for the IP stack and all of its virtual interfaces to become ready. If this parameter is not set, the native operating system IP stack will be used. | ||||||
|
XNET local interface specifies the local interface to use for this diagnostic session on the specified XNET IP Stack; used when the XNET IP Stack contains multiple virtual interfaces.
This optional parameter can be omitted if the IP Stack has only one local interface. This property is ignored if the XNET IP stack name parameter is not set. Refer to NI-XNET Hardware and Software Help for more information on this parameter. |
||||||
|
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.
|
Output
|
Diag reference out is a cluster containing all necessary information about the diagnostic session. Wire this output as a handle through all subsequent diagnostic VIs, and always close it using Close Diagnostic.vi to disconnect from the ECU and close the diagnostic session's XNET IP Stack reference. Do not abort a running VI using ADCS functions, as this may not properly clear all resources. | ||||||
|
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.
|
Description
Open Diagnostic on IP.vi 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 the Diag reference out cluster, 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, you can optionally call DoIP Get Entities.vi to find out which DoIP entities (DoIP-capable ECUs) exist in the network. Then, open a TCP/IP connection to a DoIP entity using DoIP Connect.vi. After that, you can execute diagnostic services on the TCP/IP connection.
This VI replaces the standard (CAN-based) Open Diagnostic on CAN FD.vi, because the CAN parameters are no longer relevant for IP-based diagnostics.
In general, you do not need to manipulate the Diag reference out cluster contents.



