PCAN-USB latency above 1ms-is it better to use PCAN-PCI?

USB to CAN Interface
Post Reply
fsolodovnik
Posts: 8
Joined: Fri 10. Sep 2021, 11:00

PCAN-USB latency above 1ms-is it better to use PCAN-PCI?

Post by fsolodovnik » Fri 20. Sep 2024, 10:50

Dear PEAK support

We are developing the CAN bootloader under Windows and we need to transfer several Mb of data fast.
We use request-response protocol: Windows host sends CAN frame and ECU responds with ACK frame
I have found one related topic viewtopic.php?f=181&t=7664&p=19896&hilit=latency#p19896
I used slightly modified PCANBasicExample for test: two PCANBasicExample apps wait for received CAN frame and send own CAN frame when some foreign frame comes
The pseudocode of CANReadThreadFunc looks like

Code: Select all

                if (m_ReceiveEvent.WaitOne(50))
                {
                    do
                    {
                        result = PCANBasic.Read(m_PcanHandle, out CANMsg, out CANTimeStamp);
                        if (result == TPCANStatus.PCAN_ERROR_OK) WriteFrame(1);
                        if (result == TPCANStatus.PCAN_ERROR_ILLOPERATION) break;                       
                    } while (btnRelease.Enabled && (!Convert.ToBoolean(stsResult & TPCANStatus.PCAN_ERROR_QRCVEMPTY)));
                }
I see that interframe delay is about 1-2 ms . Is it related to USB limitations? Is there any interrupt driven CAN adapter?
What can be done to reduce interframe delay?
- Use Linux?
-Use PCI adapter?

Thank You in advance
Best regards, Fedor Solodovnik
Last edited by K.Wagner on Fri 20. Sep 2024, 10:54, edited 1 time in total.
Reason: Code formatted for better reading

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

Re: PCAN-USB latency above 1ms-is it better to use PCAN-PCI?

Post by M.Heidemann » Fri 20. Sep 2024, 12:26

Hello,

If timing is this criticial a PCIe based PCAN/Interface would be our recommendation,
the USB-stack will add latency.

BR

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply