Problem with DTC reading

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
KateS
Posts: 8
Joined: Mon 23. Jul 2018, 12:48

Problem with DTC reading

Post by KateS » Fri 19. Apr 2019, 10:58

Hello,
I'm currently developing a program on C# using your APIs and I need read DTC from ECU.I use SvcReadDTCInformation(), but have problem with response.

Code: Select all

result = UDSApi.SvcReadDTCInformation(Channel, ref request,  service, mask); 
if (result == TPUDSStatus.PUDS_ERROR_OK)
 {
      result = UDSApi.WaitForService(Channel, out response, ref request, out requestConfirmation);
}
It workes fine, but when ECU answer with only one error, response.DATA shows only zeroes. Example: I want to read DTC, use this code, in PCAN-View I see (0xCF -mask, 0x07111E - one error number)
DTC.PNG
DTC.PNG (2.22 KiB) Viewed 5745 times
But in the same time after WaitForService response.DATA is empty. In other cases it worked good(more than 1 error, anorher services). Maybe You know what is the reason?

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: Problem with DTC reading

Post by K.Wagner » Tue 23. Apr 2019, 11:11

Hello,

We cannot reproduce this problem. We just used the sample code (PCUServer.exe/PCUClient.exe) for asking/simulating DTC reading, and we do receive the correct data.
SvcReadDTCInformation_Test
SvcReadDTCInformation_Test
UDS_Test.PNG (57.43 KiB) Viewed 5736 times
Could you please show the whole output of the transmission with PCAN-View? we only see the first frame of a total of 19 bytes to be transmitted. It would also be helpful to know which servic3e you are passing as parameter by the function SvcReadDTCInformation.
Best regards,
Keneth

KateS
Posts: 8
Joined: Mon 23. Jul 2018, 12:48

Re: Problem with DTC reading

Post by KateS » Mon 29. Apr 2019, 14:19

Okey. I use 0x19 services with different subfunctions (0x02 and 0x03). In my case they shall show one and the same error (for example 0x07111E) , but they don't.
In PCAN View I see
DTC in PCAN View.PNG
DTC in PCAN View.PNG (29.34 KiB) Viewed 5717 times
But I don't see the same in my code. Response for 0x19 service and 0x02 subfunction is empty for some reason, in the same time 0x19 0x03 work fine
0x19 in C#.png
0x19 in C#.png (149.84 KiB) Viewed 5717 times
When I add one more error in ECU, all work normal
0x19 in C# 2 errors.png
0x19 in C# 2 errors.png (153.98 KiB) Viewed 5717 times
DTC in PCAN View normal.PNG
DTC in PCAN View normal.PNG (28.95 KiB) Viewed 5717 times

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: Problem with DTC reading

Post by K.Wagner » Mon 29. Apr 2019, 17:24

Hello,

well, for me, it seems as the ECU has a bug, i.e. it is not sending the whole data. As far as I can understand, the ECU is saying, that 7 bytes will be sent using multi-frame: first frame, length of 7 bytes, i.e. 6 data bytes as "59 02CF 07 11 1E". The 7th bytes is never received (no consecutive frame).
One Byte is Missing
One Byte is Missing
OneByteMissing.PNG (18.81 KiB) Viewed 5716 times
Though, the whole 7 bytes should actually be sent in a single frame, as stated in the ISO 15765-2 specifications. Only longer messages should use multi-frame for sending. The data being sent from your ECU should be "07 59 02 CF 07 11 1E XX", where 7 is the data length, and XX is the failing byte.

You also are looking at the data before checking if the result of calling WaitForService is OK.
CHecking data before checking result
CHecking data before checking result
CheckResult.PNG (12.68 KiB) Viewed 5716 times
Note that the function is possibly returning PUDS_ERROR_NO_MESSAGE, since the message was never received completely.
Best regards,
Keneth

KateS
Posts: 8
Joined: Mon 23. Jul 2018, 12:48

Re: Problem with DTC reading

Post by KateS » Tue 30. Apr 2019, 07:32

Looks like you are right, thank you

Post Reply