{"id":8432,"date":"2024-04-12T13:32:29","date_gmt":"2024-04-12T05:32:29","guid":{"rendered":"https:\/\/www.tosunai.com\/?p=8432"},"modified":"2025-03-24T16:28:01","modified_gmt":"2025-03-24T08:28:01","slug":"doip-function-operation-guide-tsmaster","status":"publish","type":"post","link":"https:\/\/www.tosunai.com\/en\/doip-function-operation-guide-tsmaster\/","title":{"rendered":"Vehicle Ethernet | DoIP Function Operation Guide for TSMaster"},"content":{"rendered":"
Vehicle Ethernet Diagnostic Protocol, Diagnostics over Internet Protocol abbreviated as DoIP, allows automotive diagnostics to be performed over the Ethernet protocol.DoIP is a standardized protocol used for communication and diagnostics between vehicles or between vehicles and diagnostic equipment. With DoIP, diagnostic engineers can access and diagnose a vehicle's electronic systems over Ethernet or remotely, and can perform diagnostic access and brushing of Ethernet controllers.<\/p>
DoIP is one of the important functions supported by TSMaster, this paper mainly introduces the operation of diagnostic service function in the DoIP module of TSMaster, as well as the corresponding transport layer configuration, and unfolds the operation in conjunction with the common use of diagnostic function.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
Keywords in this article: DoIP, in-vehicle Ethernet diagnostics, basic diagnostics, automated diagnostic process, Ethernet\n\n<\/p>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t The process of creating and basically using the DoIP module of TSMaster is as follows:<\/p> \u25b2 Step1: DoIP is located in the main menu [Application] -> [DoIP], as in Figure 2-1.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t \u25b2 Step3: Set the on-board Ethernet transport layer parameters according to the configuration of the ECU, such as diagnostic instrument type, channel, IP address of the device under test, and other Ethernet parameters and security access algorithms. The specific operation process is expanded in section 3 below.<\/p> \u25b2 Step4: When configure the transport layer related parameters and security algorithm, start the project, click [Connect DUT] to connect the vehicle controller. When the connection is successful, the Basic Diagnostics window and the System Message window will prompt: Connect Ethernet DUT successfully, as in Figure 2-3. as well as in the place of ISO15765-2 you can see the service message of the connection, as in Figure 2-4.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t The network interface configuration process for TSMaster is as follows:<\/p> \u25b2 Step1:Find the main menu [Hardware] -> [TCP\/IP Stack], as in Figure 3-1.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t The configuration of the diagnostic transport layer is divided into two types depending on the type of diagnostic instrument:TE Series Devices and Systems TCP\/IP<\/strong>.<\/p> \u00a0<\/p> 4.1.1 TE series equipment For the DoIP Diagnostics Transport Layer ISO TP, the Ethernet parameters and Diagnostics ID parameters for the DUT and tester are included, as shown in Figure 4-1.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t The specific parameters of the DoIP Diagnostics Transport Layer ISO TP are described in the following categories:<\/p> \u25b2 Bus type: diagnoses the transport layer type. \u25b2 Diagnostic Instrument Type: Type of diagnostic equipment.<\/p> Connect the PC via USB, the type of diagnostic instrument selected is [TE series device], if it is a traditional network cable connection to the PC then select the system TCP\/IP, as shown in Figure 4-3.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t \u25b2 Channel: Logical channel used by the diagnostic module.<\/p> TSMaster supports multiple diagnostic modules to work online at the same time. Here is used to select the application logic channel of the current diagnostic module, which is selected through the drop-down list, as shown in Figure 4-4.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t \u25b2 IP Address Mask: IP address mask used for Ethernet communication.<\/p> \u25b2 DUT IP: IP address of the DUT. \u25b2 DUT port: DUT port number. \u25b2 Tester IP: IP address of the tester. \u25b2 Tester port: port for tester or PC \u25b2 Request ID \/ Answer ID \/ Function ID: Sets the ID of the diagnostic request\/answer\/function frame of the PC tool side of the diagnostic module.<\/p> \u00a0<\/p> 4.1.2 System TCP\/IP<\/span> The DoIP diagnostic transport layer, ISO TP, contains the Ethernet parameters and diagnostic ID parameters for the DUT and tester, as shown in Figure 4-5.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t The specific parameters of the DoIP Diagnostics Transport Layer ISO TP are described in the following categories:<\/p> \u25b2 Bus type: diagnoses the transport layer type. \u25b2 Diagnostic Instrument Type: Type of diagnostic equipment. \u25b2 Channel: Logical channel used by the diagnostic module. \u25b2 IP Address Mask: IP address mask used for Ethernet communication.<\/p> \u25b2 DUT IP: IP address of the DUT. \u25b2 DUT port: DUT port number. \u25b2 Tester IP: The IP address of the network port of the PC's system. \u25b2 Tester port: port for tester or PC \u25b2 Request ID \/ Answer ID \/ Function ID: Sets the ID of the diagnostic request\/answer\/function frame of the PC tool side of the diagnostic module.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t 4.2.1 Routing activation<\/strong><\/span><\/p> Automatically execute the route activation command after connecting to the DUT]: After checking the box, the software will automatically execute the route activation command when the tester or PC establishes a network connection with the DUT.<\/p> [TCP Initialization Activation Timeout]: this parameter describes the maximum timeout from when the TCP_Data connection has been established until it expires. If the command to activate the route is not executed within the set time range, the DoIP module will actively close the TCP_Data socket. The specification defines the time as 2000ms.<\/p> [Activation Type], there are 5 types:<\/p> \u00a0<\/p> 4.2.2 P2 time parameters<\/strong><\/span><\/p> P2 Timeout]: Indicates the minimum time interval for the ECU to reply after receiving a diagnostic request frame. For the diagnostic tool, this parameter can be used as a timeout judgment parameter for waiting for a reply after sending a request. For example, if the diagnostic tool sends a diagnostic message and does not receive a reply within the P2 timeout period, the request is considered to have failed, and the timeout period exits.<\/p> P2 extension time]: When the diagnostic tool sends out a diagnostic message, and the ECU under test is too late to respond within the P2 timeout period, it replies with a frame 7F XX 78 message to tell the diagnostic tool that it is too late to respond, and it needs to extend the waiting time before replying, and then after the ECU sends out a delayed waiting message, it switches the waiting time parameter to the P2 extension time. After the ECU sends a delayed wait message, it switches the wait time parameter to P2 extended time.<\/p> The above two parameters can be tapped on the [Details] button to view the graphical description, as shown in Figure 4-11.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t 4.2.3 Diagnostics online<\/strong><\/span><\/p> \u00a0<\/p> Diagnostics Online includes S3 Server Time and S3 Client Time parameters. [S3 Client Time]: indicates the time interval for sending TesterPresent frames as the diagnostic Tester side.<\/p> For the schematic diagrams of the above two parameters, you can tap the [Details] button to view the graphical description, as shown in Figure 4-12.<\/p><\/section> When enabling [Diagnoser Online], a switch to activate [Diagnoser Online] appears above the diagnostic module. Setting the Diagnoser Online to [On] state, the message is sent according to the set S3 client time interval.<\/p> The send byte for Diagnostics Online is optional. Three types are supported:<\/p> \u00a0<\/p> 4.2.4 Seed Keys<\/strong><\/span><\/p> TSMaster provides two methods for handling SeedKey seed keys. The first one is the commonly used DLL dynamic link library that loads the mainstream SeedKey; the second one provides a built-in SeedKey interpreter, which can directly write the SeedKey source code and can be saved to generate a DLL dynamic link library.<\/p> -4.2.4.1 Loading dynamic link libraries<\/p> TSMaster not only supports DLL files encapsulated in C\/C++, Delphi and other languages, but also adds support for DLL libraries based on DotNet platforms such as C#, VB.Net and other languages, which is efficiently compatible with DLLs generated by different platforms for secure access, bringing engineers a more convenient experience.<\/p> Load the dynamic link library loading screen, as shown in Figure 4-14.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t The icons are in order from left to right:<\/p> [1] Load DLL<\/p> [2] Delete DLL<\/p> [3] Open the DLL checker, through the DLL checker, the user can judge whether the loaded DLL interface is correct or not, and whether the algorithm meets the design requirements. For example, after the user selects the Level of Seed, input the Seed value and click GenKey to judge. If the interface of the DLL is unified with the interface defined in the template, a message will be output: Generate Key Success, and then the user can further confirm whether the algorithm in the DLL meets the design requirements according to the comparison between the Key value and the target value. As in Figure 4-15.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t [4] You can open the file path where the Seed&Key interface project is located in the TSMaster installation directory.<\/p> In the TSMaster installation directory, there are template projects that encapsulate the Seed&Key algorithm. TSMaster supports SeedKey function interface by default as follows:<\/p> unsigned int GenerateKeyEx( \u00a0<\/p> unsigned int GenerateKeyExOpt( bool ASAP1A_CCP_ComputeKeyFromSeed( \u00a0<\/p> How to be compatible with other function interfaces<\/strong><\/em><\/p> In daily use, it often happens that the user has already developed a SeedKey DLL, but the interface of this DLL is not any of the three mentioned above, so it can't be directly loaded into the diagnostic module of TSMaster. In this case, the existing SeedKey algorithm library can be packaged in the form of secondary packaging to generate a DLL that can be directly loaded into the TSMaster diagnostic module.<\/p> With a practical example to explain how to be compatible with other interface functions of the DLL file, the schematic diagram of the secondary packaging process, such as Figure 4-16.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t \u25b2 Step 1: Check the current DLL with the name UserSeedKey.DLL. the API functions inside this function are:<\/p>1. TSMaster DoIP's TOSUN Ethernet hardware preparation\n\n\n\n\n\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\u2756 TE1051<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\u2756 TE1021\n\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
2\u3001How to start using TSMaster DoIP module\n\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
3\u3001TSMaster diagnostic instrument IP network interface configuration\n\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
4. TSMaster DoIP Diagnostics Transport Layer Configuration\n\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\u2756 4.1 Diagnosing the Transport Layer\n\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
<\/strong><\/span>TE series device types take TE1051 as an example, TE1051 is a 1-way Ethernet to USB interface tool, which transfers to PC via USB interface and realizes DoIP function of Ethernet data through TSMaster software.<\/p>\t\t\t\t\t\t\t\t\t\t\t
Use TOSUN DoIP function to select the bus type as [Ethernet], as shown in Figure 4-2.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
In DoIP communication, the IP address mask and the IP address of the device under test need to be set according to the specific network topology and communication requirements.<\/p>
In the ISO 13400 standard port 13400 is designated as the default port number for DoIP communications.<\/p>
The tester IP is the IP address of the test device (e.g., TOSUN's TE051) connected to the PC. According to the IP address mask and the IP address of the device under test, configure the IP address of the PC and the IP address of the device under test in the same network segment, so that they can connect and communicate normally. The configuration of the IP address of the tester has been described in detail in the previous Chapter 3.<\/p>
Note: There are no fixed rules for the port number setting of the diagnostic tool, users can set their own port number or use the port number automatically assigned by the software according to their needs.<\/p>
<\/strong>The system TCP\/IP type is taken as an example, the TE1021 is connected to the PC directly through the system's network port.<\/p>\t\t\t\t\t\t\t\t\t\t\t
Use TOSUN DoIP function to select the bus type as [Ethernet], as shown in Figure 4-6.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
If the diagnostic instrument is connected to the PC through the network port of the PC system, the diagnostic instrument type selected is [System TCP\/IP], as shown in Figure 4-7.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Used to select the application logical channel of the current diagnostic module, here the default is [System Ethernet Interface], as shown in Figure 4-8.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
In DoIP communication, the IP address mask and the IP address of the device under test need to be set according to the specific network topology and communication requirements.<\/p>
In the ISO 13400 standard port 13400 is designated as the default port number for DoIP communications.<\/p>
Based on the IP address mask and the IP of the test piece, configure the IP address of the PC and the IP of the test piece in the same network segment, so that the two can connect and communicate normally. Find the [Settings] -> [Network and Internet] of the PC, find the Ethernet that the network port is connected to, select [Properties], and select the [Edit] button in [IP Assignment]. Select Manual, open IPv4, and fill in the IP address as well as the subnet mask. As shown in Figure 4-9.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
Note: There are no fixed rules for the port number setting of the diagnostic tool, users can set their own port number or use the port number automatically assigned by the software according to their needs.<\/p>\u2756 4.2 Diagnostic service layer\n\n\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
[S3 Server Time]: Indicates the timeout period after the ECU has been switched from the Default session to another session, and how long it will automatically switch back to the Default session.<\/p>\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
const unsigned char* ipSeedArray, \/* Array for the seed [in] *\/
unsigned int iSeedArraySize, \/* Length of the array for the seed [in] *\/
const unsigned int iSecurityLevel,\/* Security level [in] *\/
const char* ipVariant, \/* Name of the active variant [in] *\/
unsigned char* iopKeyArray, \/* Array for the key [in, out] *\/
unsigned int iMaxKeyArraySize, \/* Maximum length of the array for the key [in] *\/
unsigned int& oActualKeyArraySize); \/* Length of the key [out] *\/<\/p>
const unsigned char* ipSeedArray, \/* Array for the seed [in] *\/
unsigned int iSeedArraySize, \/* Length of the array for the seed [in] *\/
const unsigned int iSecurityLevel, \/* Security level [in] *\/
const char* ipVariant, \/* Name of the active variant [in] *\/
const char* iPara, \/* *\/
unsigned char* iopKeyArray, \/* Array for the key [in, out] *\/
unsigned int iMaxKeyArraySize, \/* Maximum length of the array for the key [in] *\/
unsigned int& oActualKeyArraySize) \/* Length of the key [out] *\/<\/p>
const unsigned char* ipSeedArray, \/* Array for the seed [in] *\/
unsigned short iSeedArraySize, \/* Length of the array for the seed [in] *\/
unsigned char* iopKeyArray, \/* Array for the key [in, out] *\/
unsigned short iMaxKeyArraySize, \/* Maximum length of the array for the key [in] *\/
unsigned short* opSizeKey) \/* Length of the key [out] *\/<\/p>\t\t\t\t\t\t\t\t\t\t\t