Change CAN ID UDS

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
ab_eolane
Posts: 2
Joined: Thu 10. Jan 2019, 09:34

Change CAN ID UDS

Post by ab_eolane » Thu 10. Jan 2019, 09:50

Hi,
I am using the PCAN-UDS.cs in a C# project where I want to use my own CAN ID.
When I set the PROTOCOL to PUDS_PROTOCOL_ISO_15765_2_29B it uses CAN ID : 0x18DAxxyy
I know how to modify xx and yy but I would like to modify 0x18DA to 0x14DA.

With the C# dll anyone knows how to do it?


Thanks,
A

ab_eolane
Posts: 2
Joined: Thu 10. Jan 2019, 09:34

Re: Change CAN ID UDS

Post by ab_eolane » Thu 10. Jan 2019, 12:02

Ok, I think I have managed to send the correct CAN ID. I have added the CAN ISO TP dll to my C# project.

To add a mapping I do the following :

Code: Select all

 
TPstatus = AddMapping(
    handle,
    0x14DA08F9,
    0x14DAF908,
    TPCANTPIdType.PCANTP_ID_CAN_29BIT,
    TPCANTPFormatType.PCANTP_FORMAT_NORMAL,
    TPCANTPMessageType.PCANTP_MESSAGE_DIAGNOSTIC,
    0xF9, 0x08, TPCANTPAddressingType.PCANTP_ADDRESSING_PHYSICAL, 0);

TPstatus = AddMapping(handle,
    0x14DAF908,
    0x14DA08F9,
    TPCANTPIdType.PCANTP_ID_CAN_29BIT,
    TPCANTPFormatType.PCANTP_FORMAT_NORMAL,
    TPCANTPMessageType.PCANTP_MESSAGE_DIAGNOSTIC,
    0x08, 0xF9, TPCANTPAddressingType.PCANTP_ADDRESSING_PHYSICAL, 0);
However, when I send a message it doesn't get the reply (the reply is sent I checked).

Any idea what could go wrong ?

Thanks,
A.
Last edited by K.Wagner on Thu 10. Jan 2019, 12:20, edited 2 times in total.
Reason: Code formatting for better reading

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

Re: Change CAN ID UDS

Post by K.Wagner » Thu 10. Jan 2019, 14:55

Hello,

first of all, please do not ask the same request twice (support email and in the forum). This just cause overhead.

We already answered your question per email, though we just realized, that we got an automatic response indicating that the email was not delivery due to your mail server configuration. Here our anser:
In order to use a different CAN ID you need to add a mapping for it. You can do this by using the underlaying PCAN-ISO-TP API, using the same Handle you have initialized with UDS, or directly over UDS, by using the function UDS_SetValue (see parameters PUDS_PARAM_MAPPING_ADD / PUDS_PARAM_MAPPING_REMOVE).

Mappings involving physically addressed communication are most usually defined in pairs: the first mapping defines outgoing communication (i.e. request messages from node A to node B) and the second to match incoming communication (i.e. responses from node B to node A).
ab_eolane wrote: Ok, I think I have managed to send the correct CAN ID. I have added the CAN ISO TP dll to my C# project.

To add a mapping I do the following :
However, when I send a message it doesn't get the reply (the reply is sent I checked).
The mappings are OK. In my test it works.. My client sends the 0x14DA08F9 and receives the 0x14DAF908. Please note that your ECU should support these IDs as well
Best regards,
Keneth

Post Reply