The data didn't send

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
H.Tina
Posts: 15
Joined: Tue 8. Jan 2019, 03:14

The data didn't send

Post by H.Tina » Mon 4. Mar 2019, 11:51

Dear sir
I used the PCAN-UDS function
status = UDSApi.SvcWriteDataByIdentifier(m_PcanHandle, ref request, (ushort)UDSApi.TPUDSSvcParamDI.PUDS_SVC_PARAM_DI_ASFPDID, buffer, (ushort)buffer.Length);
to send data.the length of data is more than 7 ,but when the ECU send 30 00 05,the remain data did't send.why ?
how to solve it ?
best wishes
Attachments
OYY`2BEE1P1@SL9DVZN[4S7.png
OYY`2BEE1P1@SL9DVZN[4S7.png (3.12 KiB) Viewed 5205 times

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

Re: The data didn't send

Post by F.Vergnaud » Tue 5. Mar 2019, 11:24

Hello Tina,

The CAN IDs 0x702, 0x70A are not standardized CAN IDs. In order to properly use those CAN IDs in your UDS communication, you need to define 2 "Network Address Information" mappings with the parameter PUDS_PARAM_MAPPING_ADD (one mapping for the communication "to the ECU" and another "from the ECU"):

Code: Select all

  UDS_SetValue(Channel, PUDS_PARAM_MAPPING_ADD, &message, sizeof(Message));
You will find more information and an example in the PCAN-UDS documentation §4.3.2, p.339.
Best regards,
Fabrice

H.Tina
Posts: 15
Joined: Tue 8. Jan 2019, 03:14

Re: The data didn't send

Post by H.Tina » Tue 5. Mar 2019, 12:32

Dear sir
sorry ,I didn't understand what you said.
I have mapped the ID like this
TPCANTPStatus result;
uint canID = 0x702;
uint canIDResponse = 0x70A;
byte N_SA =(byte)TPUDSAddress.PUDS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
byte N_TA = (byte)TPUDSAddress.PUDS_ISO_15765_4_ADDR_ECU_8;
byte N_RA = 0x00;
result=CanTpApi.AddMapping (m_PcanHandle ,canID,canIDResponse,TPCANTPIdType.PCANTP_ID_CAN_11BIT , TPCANTPFormatType.PCANTP_FORMAT_NORMAL ,TPCANTPMessageType .PCANTP_MESSAGE_DIAGNOSTIC ,N_SA ,N_TA ,TPCANTPAddressingType .PCANTP_ADDRESSING_PHYSICAL ,N_RA );

result =CanTpApi.AddMapping (UDSApi .PUDS_USBBUS1 ,canIDResponse ,canID,TPCANTPIdType.PCANTP_ID_CAN_11BIT , TPCANTPFormatType.PCANTP_FORMAT_NORMAL ,TPCANTPMessageType .PCANTP_MESSAGE_DIAGNOSTIC ,N_TA,N_SA,TPCANTPAddressingType .PCANTP_ADDRESSING_PHYSICAL ,N_RA );

Do you mean before mapping ,I need to do this
Attachments
4Y9GNFXWGJUZHS_4XL@H1TS.png
4Y9GNFXWGJUZHS_4XL@H1TS.png (82.05 KiB) Viewed 5189 times

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

Re: The data didn't send

Post by F.Vergnaud » Tue 5. Mar 2019, 13:15

Using PCAN-ISO-TP API directly to configure mappings is fine (the parameter PUDS_PARAM_MAPPING_ADD with the UDS SetValue function is just another way to do it).

Regarding your issue, do you confirm that the returned values to your calls to CanTpApi.AddMapping are PCANTP_ERROR_OK? FYI, you are using the channel handle "m_PcanHandle" for the first call and "UDSApi .PUDS_USBBUS1" on the second call...

Please provide a more complete excerpt of your code, if it is the case.
Best regards,
Fabrice

ValeV

Re: The data didn't send

Post by ValeV » Mon 25. Mar 2019, 15:01

Hi, can I use this thread to ask quick related question?

After hours of looking for an error why my custom mappings didn't work, I found out that SA/TA must be set to 0xF1. (I tried to use SA=0x01 and TA=0x02).

I 0xF1 a must have as SA/TA (depending if i'm transmitting or receiving) ?

Thank you in advance for the answer.

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

Re: The data didn't send

Post by K.Wagner » Mon 25. Mar 2019, 15:12

Hello,

0xF1 is the physical address for external test equipment, i.e. the address of the diagnostic application (tester). This is defined in ISO 14229 and ISO 15765-4.
Best regards,
Keneth

Post Reply