Page 1 of 1
The data didn't send
Posted: Mon 4. Mar 2019, 11:51
by H.Tina
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
Re: The data didn't send
Posted: Tue 5. Mar 2019, 11:24
by F.Vergnaud
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.
Re: The data didn't send
Posted: Tue 5. Mar 2019, 12:32
by H.Tina
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
Re: The data didn't send
Posted: Tue 5. Mar 2019, 13:15
by F.Vergnaud
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.
Re: The data didn't send
Posted: Mon 25. Mar 2019, 15:01
by ValeV
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.
Re: The data didn't send
Posted: Mon 25. Mar 2019, 15:12
by K.Wagner
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.