PCAN-USB latency above 1ms-is it better to use PCAN-PCI?
Posted: 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
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
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)));
}
What can be done to reduce interframe delay?
- Use Linux?
-Use PCI adapter?
Thank You in advance
Best regards, Fedor Solodovnik