XCP error message as human readable strings

A free API for the communication with control units based on the Universal Measurement and Calibration Protocol (XCP) by ASAM for Windows®
Post Reply
msoum
Posts: 1
Joined: Mon 25. Sep 2017, 11:54

XCP error message as human readable strings

Post by msoum » Mon 25. Sep 2017, 12:02

Hello,

I am using both the PCAN Basic APIs and the PXCP APIs. I have noticed that PCAN Basic provide a method (CAN_GetErrorText in C++) to which we give a return code and it gives back a human readable message about the error code.
This feature is both useful for the developer (debugging process) and for the end user to see what's wrong when something is.
But I did not see an equivalent method in the PXCP APIs.
Did I miss it or did it just not exist ?
I tried using the PCAN Basic API but it does not return the correct message for a given error code (e.g. XCP_ERR_OK gives "The test of the CAN controller hardware registers failed (no hardware found)").

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

Re: XCP error message as human readable strings

Post by K.Wagner » Tue 26. Sep 2017, 12:38

Hello,
msoum wrote:Did I miss it or did it just not exist ?
you are right. Neither XCP API nor CCP API have such a function. This was actually not a requirement at the time those APIs were written.
msoum wrote:But I did not see an equivalent method in the PXCP APIs.
The application area for XCP/CCP APIs were different. The function exists for PCAN-Basic since that API was thought to be used mainly with an User Interface. The other APIs were thoughts to be used for flashing (service oriented), so normal codes should be enough for error handle within the flash process.
msoum wrote:I tried using the PCAN Basic API but it does not return the correct message for a given error code (e.g. XCP_ERR_OK gives "The test of the CAN controller hardware registers failed (no hardware found)")
You can use error codes of XCP with PCAN-Basic only if the error was in the transport channel, i.e. the error code is marked with the flag XCP_ERR_TRANSPORT_CHANNEL. This means, the returned value (ignoring the flag) represents in this case a PCAN-Basic error. More information in the chapter "Introduction/About PCAN-XCP/Return Codes" of the PCAN-XCP documentation.

Nevertheless, it would indeed be helpful to have such a function within the other APIs. We will take this into consideration. Thanks for your recommendation.
Best regards,
Keneth

Post Reply