Peak.PCANBasic.NET and linux

The free CAN Software API (Application Programming Interface) for Windows®
Post Reply
ranba790
Posts: 6
Joined: Tue 30. Jul 2024, 14:07

Peak.PCANBasic.NET and linux

Post by ranba790 » Wed 7. Aug 2024, 10:53

Hi
If i understand correctly to use Peak.PCANBasic.NET with PCAN-Ethernet Gateway DR i need to use Virtual PCAN gateway.
The Virtual PCAN Gateway is only supported on Windows.
Is there a way to use Peak.PCANBasic.NET with PCAN-Ethernet Gateway DR or my only option is to use Sockets if i need both windows and linux version
Is there a different Ethernet to CAN adapter that can be used so it will work with both Windows and Linux and Peak.PCANBasic.NET
Thanks

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Peak.PCANBasic.NET and linux

Post by M.Heidemann » Wed 7. Aug 2024, 12:32

Hello,

no there is no way to do both at the same time.

You could use a socket based approach that is multi-platform
but it will not be compatible to PCAN-Virtual Gateway, as the
requirements for routes (handshake off, etc) arent comaptible
between the 2 operational modes.

BR

Marvin
---
Marvin Heidemann
PEAK-Support Team

ranba790
Posts: 6
Joined: Tue 30. Jul 2024, 14:07

Re: Peak.PCANBasic.NET and linux

Post by ranba790 » Sun 11. Aug 2024, 12:14

Hi.
Thanks for the info.
do you have a VB.net or C# example for using socket for a send and receive Can data with the gateway.
Thanks

ranba790
Posts: 6
Joined: Tue 30. Jul 2024, 14:07

Re: Peak.PCANBasic.NET and linux

Post by ranba790 » Sun 11. Aug 2024, 16:26

Hi
No need for example , i got it to work using sockets.
Any tips for performance that you have will be greatly appreciated
Ran

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Peak.PCANBasic.NET and linux

Post by M.Heidemann » Mon 12. Aug 2024, 09:15

Well,

try to keep the queues empty, maybe use events to reduce loop overhead.
discared messages you don't need to process (software filter),
make sure rx and tx are handled seperately and in a controlled manner.

I think that's the extend of it-

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

ranba790
Posts: 6
Joined: Tue 30. Jul 2024, 14:07

Re: Peak.PCANBasic.NET and linux

Post by ranba790 » Mon 12. Aug 2024, 09:55

Hi
Thanks for the quick response.
Is there a way to send multiple Can messages in one UDP packet. from the PC to the gateway?
Also, I have it setup as Frame Per packet = 15 in UDP mode with tcp Delay checked.
I am still getting only one Frame per packet but i have only one client on the can bus.
Does this feature works in UDP mode.
What is the time out(how long does the gateway wait before sending the packet)
How does the data byte array looks like , right now i am getting 36 bytes for one frame in a packet. will i get multiple of 36 bytes
Thanks

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Peak.PCANBasic.NET and linux

Post by M.Heidemann » Mon 12. Aug 2024, 09:58

Please see chapter 1.3.2 of the Gateway Developer docs:

https://www.peak-system.com/produktcd/P ... on_eng.pdf

This should answer most of your questions

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply