Functional Address

A free API for the transfer of data packages according to ISO-TP (ISO 15765-2)
Post Reply
mdanski
Posts: 17
Joined: Tue 28. Aug 2018, 13:57

Functional Address

Post by mdanski » Tue 19. Mar 2019, 13:09

Hello,

I am trying to define custom functional address 0x750. First of all I defined network address info:

Code: Select all

// Define functional address
TPUDSNetAddrInfo AddressInfoFunctional = new TPUDSNetAddrInfo
{
	SA = (byte)TPUDSAddress.PUDS_ISO_15765_4_ADDR_TEST_EQUIPMENT,
	TA = (byte)TPUDSAddress.PUDS_ISO_15765_4_ADDR_OBD_FUNCTIONAL,
	TA_TYPE = TPUDSAddressingType.PUDS_ADDRESSING_FUNCTIONAL,
	RA = 0x00,
	PROTOCOL = TPUDSProtocol.PUDS_PROTOCOL_ISO_15765_2_11B
};
Then I try to send using this part of code:

Code: Select all

// Part used to send 
TPUDSMsg msg = new TPUDSMsg { NETADDRINFO = AddressInfoFunctional };
msg.DATA = new byte[4095];
// here put bytes into message
TPUDSStatus statusSendMsg = UDSApi.Write(Channel, ref msg);
Everything works fine, but ID of sent message is 0x7DF (as defined in ISO) and I want it to use ID 0x750 so I tried to add mapping:

Code: Select all

// Define ISO-TP communication from Tester to All (functional requests)
TPCANTPStatus status = CanTpApi.AddMapping(
		Channel,
		functionalId,
		CanTpApi.CAN_ID_NO_MAPPING,
		TPCANTPIdType.PCANTP_ID_CAN_11BIT,
		TPCANTPFormatType.PCANTP_FORMAT_NORMAL,
		TPCANTPMessageType.PCANTP_MESSAGE_DIAGNOSTIC,
		AddressInfo.SA,
		AddressInfo.TA,
		TPCANTPAddressingType.PCANTP_ADDRESSING_FUNCTIONAL,
		0x00);
Mapping returns no error, but functional still uses 0x7FD. How can I force to send functional messages with ID 0x750?

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

Re: Functional Address

Post by F.Vergnaud » Tue 19. Mar 2019, 14:53

Hello,

Your call to AddMapping should have returned an error: a similar mapping already exists, which version of PCAN-ISO-TP are you using?

Anyway, you need to remove the standardized mapping first using function RemoveMapping with the can id 0x7DF (PUDS_ISO_15765_4_CAN_ID_FUNCTIONAL_REQUEST).
Best regards,
Fabrice

mdanski
Posts: 17
Joined: Tue 28. Aug 2018, 13:57

Re: Functional Address

Post by mdanski » Wed 20. Mar 2019, 08:29

Hello,
I checked that AddMapping is returning PCANTP_ERROR_OK. I am using PCAN-ISO-TP API Library 2.0.2.102 64 bit.

I added removing mapping and i changed TA in Network Address Info and now I can see using PCAN View that there are frames send on ID 750.

Code: Select all

// Define functional address
TPUDSNetAddrInfo AddressInfoFunctional = new TPUDSNetAddrInfo
{
   SA = (byte)TPUDSAddress.PUDS_ISO_15765_4_ADDR_TEST_EQUIPMENT,
   TA = (byte)PUDS_ISO_15765_4_ADDR_ECU_1,
   TA_TYPE = TPUDSAddressingType.PUDS_ADDRESSING_FUNCTIONAL,
   RA = 0x00,
   PROTOCOL = TPUDSProtocol.PUDS_PROTOCOL_ISO_15765_2_11B
};
Thanks for your assistance!

Post Reply