Multi-Frame Messages - Not all data is sent

A free API for the transfer of data packages according to ISO-TP (ISO 15765-2)
Post Reply
K1890350
Posts: 20
Joined: Mon 7. Mar 2022, 13:13

Multi-Frame Messages - Not all data is sent

Post by K1890350 » Tue 31. May 2022, 12:09

Hi,

I've previously managed to send multi-frame messages (<10 bytes long). However, when I try and send a longer message, let's say 30 bytes long, I can only see the first 8 bytes of that message sent on my PEAK trace.

Points to consider:
- I've set my BS to 0 as that allows unlimited CF to be sent after the FF
- STMin set to 10 millis

Have I missed out on a parameter? Please advise.

Best wishes,
K1890350

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

Re: Multi-Frame Messages - Not all data is sent

Post by F.Vergnaud » Tue 31. May 2022, 12:18

Hello,

Please make sure you configured your mappings correctly (in both direction, see documentation on function CANTP_AddMapping),
you can check how it is done in sample 02_client_ISO15765-2_normal_addressing.

If additionnal attempts fail, please feel free to share with us your ISOTP communication configuration and/or a sample.
Best regards,
Fabrice

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

Re: Multi-Frame Messages - Not all data is sent

Post by K.Wagner » Tue 31. May 2022, 12:32

Hello,

please note, if you are able to send segmented frames for a message with a length of 10, you are also able to send messages with greater length. The segmentation process is the same for anything with a length > 7. There is no reason why the one case works and the other doesn't.

Also note that we have had already a discussion on this with you. In that case was also a mapping the problem, see Send Multi-Frame Messages to Other Devices. You stated, that you were able to successfully run the sample called "06_isotp_segmented_read_write". This example does send huge amount of data in a segmented way.

Please check the example again and compare to your code.
Best regards,
Keneth

K1890350
Posts: 20
Joined: Mon 7. Mar 2022, 13:13

Re: Multi-Frame Messages - Not all data is sent

Post by K1890350 » Tue 31. May 2022, 13:13

Hi,

Thank you for the reply.

Below is an identical example of what I'm working with. It includes mapping parameters.
MF Example.txt
(6.94 KiB) Downloaded 354 times
Due to data protection, I cannot share the exact message I'm trying to send. For example sake, consider a message containing (a random set of) 255 bytes.

If anything else is required, do let me know.

I appreciate your help.

K1890250

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

Re: Multi-Frame Messages - Not all data is sent

Post by K.Wagner » Tue 31. May 2022, 13:21

Hello,

Are you able to run the example? please try it first. It shows anything you need to send multi-frame packages. Just compare the configuration made in it with your code and try again.

Please note that the scope of service given for the APIs does not include code review or companion development.

Thanks for your understanding,
Best regards,
Keneth

K1890350
Posts: 20
Joined: Mon 7. Mar 2022, 13:13

Re: Multi-Frame Messages - Not all data is sent

Post by K1890350 » Tue 31. May 2022, 13:34

Hi,

Yes, I'm able to run this program.

When I view my trace, I can see my FF, followed by a Flow Control Frame, then 8 CF bytes, another Flow Control Frame, but nothing after that when there should be the remaining bytes sent too.

I'm sending a TP message at the same time at a 1-second interval. Though, I don't think this could cause only half of my message multi-frame messages to be sent.

I have looked at the CANTP 06 unsegmented message example, which sends a message much larger than mine in 2 or so seconds. Hence, I'm unsure what I need to change to have the entire 255 byte message sent, and not a portion of it.

Best,
K1890350

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

Re: Multi-Frame Messages - Not all data is sent

Post by K.Wagner » Tue 31. May 2022, 14:45

Dear,

I took a short look at your code and found things that I do not understand, for instance:

Code: Select all

/* Indicate a Multiframe message is being communicated. Number of frames derived by length of message */
VCD_LDC = CanTpApi.SetValue_2016(cantp_handle.PCANTP_HANDLE_USBBUS1,
        (cantp_parameter)cantp_isotp_msgtype.PCANTP_ISOTP_MSGTYPE_FLAG_INDICATION, 
        new byte[] { 0 }, 
        CTRL_DATA.msgSize);
Where did you read, that you can apply a message flag as a parameter? Did you ever read the documentation?

it seems to me as you are just trying things by luck. We cannot help in this way. We always try to help our customers in their issues best as we can, but this can only be achieved if the user has an idea of what he is doing. This implies knowing the protocol used, reading the API documentation, and studying the sample projects.

If you check the chapter 2.2 you will see in short the minimum you need to do for doing ISO-TP communication (see picture at the bottom).

So, first, initialize your channel, second, do your mappings, third, use CANTP_Read_2016 for reading and CANTP_Write_2016 for writing ISO-TP frames, and finally, use CANTP_Uninitialize_2016 to finalize the connection when it is no more needed. That is. Anything else is just communicaiton tuning, that can be done when you have first your program communicating.

Each of the functions mentioned above are well described and with a minimalistic code example within the documentation. In the CANTP_Write_2016 section, for instance, you have an example on how to issue the sending of an ISO-TP message and wait for it to be sent. Note that indications and confirmation messages are managed by the API. You don't need (and cannot) send such things like an indication flag.

Again, please read the documentation, the protocol specifications, and compare your code with the sample.
Attachments
Understanding_ISO-TP.PNG
Understanding_ISO-TP.PNG (99.44 KiB) Viewed 4601 times
Best regards,
Keneth

Post Reply