Page 1 of 1

Problem with DTC reading

Posted: Fri 19. Apr 2019, 10:58
by KateS
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 5743 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?

Re: Problem with DTC reading

Posted: Tue 23. Apr 2019, 11:11
by K.Wagner
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 5734 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.

Re: Problem with DTC reading

Posted: Mon 29. Apr 2019, 14:19
by KateS
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 5715 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 5715 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 5715 times
DTC in PCAN View normal.PNG
DTC in PCAN View normal.PNG (28.95 KiB) Viewed 5715 times

Re: Problem with DTC reading

Posted: Mon 29. Apr 2019, 17:24
by K.Wagner
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 5714 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 5714 times
Note that the function is possibly returning PUDS_ERROR_NO_MESSAGE, since the message was never received completely.

Re: Problem with DTC reading

Posted: Tue 30. Apr 2019, 07:32
by KateS
Looks like you are right, thank you