Measuring runtime of CAN frames

CAN FD Interface for High-Speed USB 2.0
Post Reply
hberb
Posts: 2
Joined: Mon 27. Mar 2023, 15:00

Measuring runtime of CAN frames

Post by hberb » Mon 27. Mar 2023, 15:29

Hi!

I am using 2 PCAN-USB FD on my Windows10 PC. These both CAN devices are connected via an external hardware which can route CAN frames from one device to the another.
Now I want to measure the runtime of a CAN frame from sending it on the first CAN-USB FD to receiving it on the second PCAN-USB FD.

Can I use the PCAN-View software for this? It seem the Times showing in the Trace Tab of several PCAN-View instances are independent.
Can I switch the Times to the system time?

Can I handle several PCAN-USB FD in one PCAN-View and see both PCAN-USB FD in one Trace Tab?

Regards

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Measuring runtime of CAN frames

Post by PEAK-Support » Mon 27. Mar 2023, 15:47

PCAN-View could only handle one CAN Channel in one Instance of the Software.
You could use the Trace Option for log CAN Frames, and save the text based *.trc file(s).
Inside the header you will find the System Start Time and for every received CAN Frame the Offset.
So you have for 2 different started Trace files a common time base:
2Trace_Files.JPG
2Trace_Files.JPG (161.38 KiB) Viewed 5356 times
The Start Time is created based on this calculation (Windows internal time format)
See PCAN-View - Help - File Format specification.
$STARTTIME keyword to store the absolute start time of the trace file:
Format: Floating point, decimal separator is a point.
Value: Integral part = Number of days that have passed since 30. December 1899.
Fractional Part = Fraction of a 24-hour day that has elapsed, resolution is 1
millisecond.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

hberb
Posts: 2
Joined: Mon 27. Mar 2023, 15:00

Re: Measuring runtime of CAN frames

Post by hberb » Thu 20. Apr 2023, 18:22

Hello,

now I start working with PCAN-View and try to use the Trac Option to calculate the run time a CAN frame from sending it on the first CAN-USB FD to receiving it on the second PCAN-USB FD.

But unfortunately the start time is given in millisecond precision while the time offset is given in microsecond precision.
That means it could happens that the Receive time could be earlier than the transmit time:
2023-04-20 18_09_07-PeakView_trace_comparison.png
2023-04-20 18_09_07-PeakView_trace_comparison.png (86.63 KiB) Viewed 5272 times
By above example the TX frame is traced at Start time + 2740.331ms = 20/04/2023 17:23:11.167331.
By above example the RX frame is traced at Start time + 1555.862ms = 20/04/2023 17:23:11.166862.
Means the RX frames arrived 469us earlier than it was sent.
Is there a way to get the also the start time in microsecond precicion?

Thanks & Regards

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Measuring runtime of CAN frames

Post by PEAK-Support » Fri 21. Apr 2023, 09:40

The Trace for of the PCAN-View use this start time format:
$STARTTIME keyword to store the absolute start time of the trace file:
Format: Floating point, decimal separator is a point.
Value: Integral part = Number of days that have passed since 30. December 1899.
Fractional Part = Fraction of a 24-hour day that has elapsed, resolution is 1
millisecond.
There is no µS included.

Here the converting that i do with your Data:
PCAN-View_Trace_Time.JPG
PCAN-View_Trace_Time.JPG (81.04 KiB) Viewed 5266 times
In the last Table you see the Delta between send and receive. But There is alsways be a Jitter (Ofset - positive / negative). That is normal (that is the reason why you have also a minimal negative value). As the USB Interfaces have a own Firmware running, with an internel timer, they will be sync every x ms with the Host timebase on the PC, a drift in µS values is normal and could not be solved without a physical connection (time sync line) The USBX6 have this features, that all 6 CAN Channels use a sync line internally to keep th einternal tickcounter of all channels identical - no drift per channel.

Using the PCAN-Explorer 6, the Trace files use a more precise start time (only the start time is different!)
PCAN-Expl-Trace.JPG
PCAN-Expl-Trace.JPG (65.95 KiB) Viewed 5266 times
Here we have the µS included (Excel could not recalculate this - you need to do it manually ) and you have the option that the first incomming CAN Frame use the 0.000 as Start time (the time in the header is when you start the tracer, but the first time is set to ZERO - no offset to start time. But as i wrote, this is a option - not the default)
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply