UDS to a certain CANID

A free API for the communication with control devices according to UDS (ISO 14229-1)
Locked
nrathaus
Posts: 4
Joined: Tue 3. Nov 2020, 12:00

UDS to a certain CANID

Post by nrathaus » Tue 3. Nov 2020, 12:05

Hi,

I am trying to write to a certain CANID value when it sends the UDS packets

I already saw some samples that talk about using custom CANID, but from the documentation it seems I don't need it because its says that I should use (page 340):
CAN ID 0x14CEXXYY/0x14CDXXYY (data link layer priority 5)

However, I cannot see in the sample what value defines this, I understand that XX is Target Address and YY Source address, but how does 0x14CE / 0x14CD gets selected?

None of the samples I found seem to define it

The UDS packet response should be received from: 0x14DAF181

And UDS packet request should be sent to: 0x14DA81F1

BTW: I believe that TA should be F1 and the SA should be 81 from what I understand

M.Heidemann
Sales & Support
Sales & Support
Posts: 424
Joined: Fri 20. Sep 2019, 13:31

Re: UDS to a certain CANID

Post by M.Heidemann » Tue 3. Nov 2020, 12:51

Hello,

Thank you for your request.


Regarding your issues:

Have you seen this post regarding adding mapping for using different CAN-IDs?

viewtopic.php?f=182&t=3008

Furthermore this thread contains a detailed explanation of both TA and SA by my colleague Mr.Vergnaud:

viewtopic.php?f=182&t=1672

Were you able to resolve your issues with the answer provided in the forum-threads?

Best Regards

Marvin

nrathaus
Posts: 4
Joined: Tue 3. Nov 2020, 12:00

Re: UDS to a certain CANID

Post by nrathaus » Tue 3. Nov 2020, 13:37

Hi Marvin,

I am not quite following how these two answers relate to my issue, I want to call:
UDS_SvcWriteDataByIdentifier

I do not want to call UDS_Write

Also, AddMapping appears to be missing from the headers of PCAN-UDS, where are they being provided (for C++)?

Maybe it has transitioned to some new function name like: CANTP_AddMapping_2016 ?

M.Heidemann
Sales & Support
Sales & Support
Posts: 424
Joined: Fri 20. Sep 2019, 13:31

Re: UDS to a certain CANID

Post by M.Heidemann » Tue 3. Nov 2020, 14:05

Hello,

The mapping does not differ from functon to function, the mapping is used for all functions universally.

In the PCAN-UDS API the mapping can be set using the paramter "PUDS_PARAM_MAPPING_ADD" , this is mentioned on page 341 of the PCAN-UDS documentation:
PCAN-UDS-SetParam.PNG
PCAN-UDS-SetParam.PNG (5.01 KiB) Viewed 420 times
Alternatively the mapping can be changed using the underlying PCAN-ISO TP API, like mentioned
in the first post referenced.

Best Regards

Marvin

F.Vergnaud
Software Development
Software Development
Posts: 170
Joined: Mon 9. Sep 2013, 12:21

Re: UDS to a certain CANID

Post by F.Vergnaud » Tue 3. Nov 2020, 14:42

Hello,

Eventhough your request could be answered by defining a NORMAL mapping (instead of using FIXED_NORMAL addressing) as the user did in the mentioned thread by Marvin.
I'd suggested to simply change the J1939 priority configuration on your UDS channel:
- Include PCAN-ISO-TP header
- Call CANTP_SetValue (or UDS_SetValue) with the parameter PCANTP_PARAM_J1939_PRIORITY on your UDS channel

Code: Select all

	TPUDSCANHandle Channel;
	// initialization
	[...]
	// change J1939 priority
	uint8_t param = 0x05;
	Status = CANTP_SetValue(Channel, PCANTP_PARAM_J1939_PRIORITY, &param, sizeof(param));
	printf("Set PCANTP_PARAM_J1939_PRIORITY: %i\n", (int)Status);
	[...]
Your communications with 29 bits CAN identifier and FIXED NORMAL or MIXED addressing will now use the priority 5.
The generated CAN ID will be 0x14DAXXYY for FIXED_NORMAL addressing as stated in page 340.
Best regards,
Fabrice

nrathaus
Posts: 4
Joined: Tue 3. Nov 2020, 12:00

Re: UDS to a certain CANID

Post by nrathaus » Tue 3. Nov 2020, 15:09

Hi,

Thank you for the clarification, I haven't tried it yet, but I noticed that my '.h' file has a:
CANTP_SetValue_2016

function and not CANTP_SetValue, am I including the wrong file?

F.Vergnaud
Software Development
Software Development
Posts: 170
Joined: Mon 9. Sep 2013, 12:21

Re: UDS to a certain CANID

Post by F.Vergnaud » Tue 3. Nov 2020, 15:33

You are including "PCAN-ISO-TP_2016.h" which provides CANTP_SetValue_2016, this is fine.
CANTP_SetValue is defined in "PCAN-ISO-TP_2004.h", you can safely use the 2016 version.
Best regards,
Fabrice

nrathaus
Posts: 4
Joined: Tue 3. Nov 2020, 12:00

Re: UDS to a certain CANID

Post by nrathaus » Wed 4. Nov 2020, 08:31

Hi,

Thank you for that answer

Can you explain a bit how can I instruct my developer based on a provided CANID value, lets say 0x18DAxxyy

What values / code he should run?

Our software doesn't know what CANID the user will be needing, so we need to be flexible.

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

Re: UDS to a certain CANID

Post by K.Wagner » Wed 4. Nov 2020, 08:42

Hello,

Please note we can only give support on how to use our API. Information about the protocols and consulting on them is not part of our support offer. You know now that you need to create a mapping for that values, and you also know how to create a mapping. To know how to handle cases where you need to use different IDs or when to configure one or another, is your job.

If you have any other question regarding our API please feel free to open a new topic. This will be closed.

Thanks for your understanding.
Best regards,
Keneth

Locked