Only one CAN frame in each UDP packet

CAN to LAN gateway in DIN rail plastic casing
thomas_r3
Posts: 3
Joined: Wed 6. Oct 2021, 11:08

Re: Only one CAN frame in each UDP packet

Post by thomas_r3 » Wed 6. Oct 2021, 14:52

Earlier it has been said that the UDP timeout value cannot be changed.
What is the (hardcoded) timeout value?
I.e. after how many ms or us a UDP packet will be send even though the 'frames per packet' number is not yet reached?

S.Michaelsen
Hardware Development
Hardware Development
Posts: 85
Joined: Fri 10. Sep 2010, 13:11

Re: Only one CAN frame in each UDP packet

Post by S.Michaelsen » Wed 6. Oct 2021, 15:50

Hi,
the value set as 'fpp' is only the upper limit for the number of CAN frames that is sent in one UDP packet. There is no timeout. When there is a lot of traffic on CAN bus or bursts with many Frames up to 'fpp' frames might be sent in one packet but only if ther have already arrived at the time when the UDP packet is buit.

BR,
Stephan

thomas_r3
Posts: 3
Joined: Wed 6. Oct 2021, 11:08

Re: Only one CAN frame in each UDP packet

Post by thomas_r3 » Wed 6. Oct 2021, 20:50

Hi Stephan,

thanks for the answer.

How is the "time when the UDP packet is built" defined? If it's periodic, what's the periodicity?

Also, the manual implies a different behavior: "Frames per Packet: This value specifies how many CAN frames are
transmitted per IP packet. The higher the value, the greater the delay in the transmission of CAN messages."

Best
Thomas

S.Michaelsen
Hardware Development
Hardware Development
Posts: 85
Joined: Fri 10. Sep 2010, 13:11

Re: Only one CAN frame in each UDP packet

Post by S.Michaelsen » Thu 7. Oct 2021, 07:40

Hi,
the text in the documentation will be changed in future versions. The packages are build event based - triggered by incoming messages - not periodic thus there is no fixed period.

Regards,
Stephan

thomas_r3s
Posts: 8
Joined: Wed 21. Sep 2022, 17:40

Re: Only one CAN frame in each UDP packet

Post by thomas_r3s » Wed 21. Sep 2022, 17:47

Hi Stepan,

I just read FD DR developer manual section 2.1.1 'Configuring CAN IRQ Limits'...

Do I understand correctly, this (new?) feature enables me to have a new (then larger) UDP packet being sent only every 3 CAN packets?

Best Regards
Thomas

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1653
Joined: Fri 10. Sep 2010, 19:34

Re: Only one CAN frame in each UDP packet

Post by U.Wilhelm » Wed 21. Sep 2022, 18:56

This is a PCAN-Ethernet Gateway FD feature only.
Do I understand correctly, this (new?) feature enables me to have a new (then larger) UDP packet being sent only every 3 CAN packets?
All is depending on how many CAN Frames are received within a time ....

There is a other Setting that you also could use (also with the normal Gateway):

Code: Select all

FPP 15 max. CAN frames per IP packet
part of the Route definition sinse Info Version "v1.3.0". But this makes only sensce with a very High CAN Bus Load, or Burst of CAN Frames.
Otherwise you will stock by 3 - 4 CAN Frames per packet.
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

thomas_r3s
Posts: 8
Joined: Wed 21. Sep 2022, 17:40

Re: Only one CAN frame in each UDP packet

Post by thomas_r3s » Thu 22. Sep 2022, 09:25

Thanks, I'll try with the PCAN-Ethernet Gateways FD.

For the normal Gateway:
As my goal is to always aggregate 3 consecutive CAN frames into 1 IP packet, it seems I would rather need a 'min. CAN frames per IP packet'.
Do I understand correct that there is still no way to achieve this in the 'normal' Gateway?

Best
Thomas

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1653
Joined: Fri 10. Sep 2010, 19:34

Re: Only one CAN frame in each UDP packet

Post by U.Wilhelm » Thu 22. Sep 2022, 09:36

You could not set "fix" 3 CAN Frames per IP Packet. That can not work , because there is a timeout, and if this is reached the packege will be send.
And if the CAN packages comes slower as the time out it, will send the package that are arrived until this moment.
If you want to send 3 CAN Frames per packat they need to come very close - otherwise the Ethernet dataflow would "stock" because of waiting for the CAN Frames.
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

thomas_r3s
Posts: 8
Joined: Wed 21. Sep 2022, 17:40

Re: Only one CAN frame in each UDP packet

Post by thomas_r3s » Thu 22. Sep 2022, 11:19

In my application, every 20ms, 3 CAN packets are coming very close (<1ms).
Thus, if there is way to 'play' with this timeout also with the 'normal' GW, that would be apprecicated very much!

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1653
Joined: Fri 10. Sep 2010, 19:34

Re: Only one CAN frame in each UDP packet

Post by U.Wilhelm » Thu 22. Sep 2022, 11:30

As this Timeout is part of the Network Stack, we could not change it.
For example, if the device receive the 2nd CAN Frame of your 3 Frame Burst .. the device need the timeout, otherwise it need to wait until your 1st Frame from the next Burst is received (20ms).
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Post Reply