Hello,
I created a Visual Studio project which uses the pcan-basic,PCAN-UDS libraries and APIs.
I am using the PCAN USB adapter and PCAN View to trace the frames.
The pcan-basic API works, but UDS API doesn't.
I am able to successfully initialize the UDS channel and set all necessary configuration parameters.
Requesting any service e.g UDS_SvcDiagnosticSessionControl() returns PUDS_ERROR_OK, but UDS_WaitForService function returns PUDS_ERROR_CAN_ERROR and I cannot see any frames in PCAN View.
I have Windows 7 Professional OS installed in my PC.
The same program works for some other PCs, but not in my PC.
What can be the reason?
UDS API doesn't work
Re: UDS API doesn't work
Hello,
Check also if PCAN-View is showing any BUS-Error in its statusbar. If you are using the PCAN-View at the same PCAN-USB, be sure you are not configuring the PCAN-USB as "Listen Only".
Please note that it is not fair to say "the API doesn't work" when you are saying, it works in other computers. The problem is then in your PC i.e. in your configuration.vzeljka wrote:The same program works for some other PCs, but not in my PC.
Note that this is an error telling you, that something with the transport layer is not Ok, a.k.a. CAN communication. This normally means that there are physical problems. Just check which CAN error you are receiving. You need to extract this value from the actual UDS error code, and check for it in the PCAN-Basic header file:vzeljka wrote:but UDS_WaitForService function returns PUDS_ERROR_CAN_ERROR and I cannot see any frames in PCAN View.
Code: Select all
#define PUDS_ERROR_CAN_ERROR 0x80000000 // Global CAN error, use following macros to merge/fetch PCAN error
// Macros to merge/retrieve PCAN error in PCAN-UDS error
//
#define PUDS_CAN_ERROR_SET(pcan_error) (PUDS_ERROR_CAN_ERROR | pcan_error)
#define PUDS_CAN_ERROR_GET(puds_status) (puds_status - PUDS_ERROR_CAN_ERROR)
Best regards,
Keneth
Keneth
Re: UDS API doesn't work
Hi,
first I apologize for unfair name of the subject.
As result status of the network communication I get TPUDSMsg.RESULT = PUDS_RESULT_N_ERROR.
Can you please tell me how can I get UDS actual error code? Afterwards I can use those Macros to merge/retrieve PCAN error in PCAN-UDS error.
I am able to use PCAN basic library successfully and trace the frames on PCAN view.
Regarding PCAN-USB, I checked, it was not configured as "Listen Only".
Thank you for your help.
first I apologize for unfair name of the subject.
As result status of the network communication I get TPUDSMsg.RESULT = PUDS_RESULT_N_ERROR.
Can you please tell me how can I get UDS actual error code? Afterwards I can use those Macros to merge/retrieve PCAN error in PCAN-UDS error.
I am able to use PCAN basic library successfully and trace the frames on PCAN view.
Regarding PCAN-USB, I checked, it was not configured as "Listen Only".
Thank you for your help.
Re: UDS API doesn't work
Hello,
According to the help, receiving exactly a PUDS_ERROR_CAN_ERROR from UDS_WaitForService advices you that the error is in ISO-TP layer.
According to the help, receiving exactly a PUDS_ERROR_CAN_ERROR from UDS_WaitForService advices you that the error is in ISO-TP layer.
The network status error PUDS_RESULT_N_ERROR means that a general network error occurred. This error is coming from the other participant (e.g. your ECU). Please check your hardware and its configuration.vzeljka wrote:As result status of the network communication I get TPUDSMsg.RESULT = PUDS_RESULT_N_ERROR.
Best regards,
Keneth
Keneth