Tracefile Format: What dertermines which version is used?

This forum covers issues concerning multiple software products.
Post Reply
embedded.kyle
Posts: 1
Joined: Wed 23. Jan 2019, 17:18

Tracefile Format: What dertermines which version is used?

Post by embedded.kyle » Wed 23. Jan 2019, 17:36

I've written a script that will take a .trc file and annotate it based on our custom protocol in order to aid in debugging. I recently received a .trc file from a customer and my script had a hard time parsing it. After looking into it, I noticed that the header was different. Here is the header from the file I received:

Code: Select all

;$FILEVERSION=2.0
;$STARTTIME=43483.3634219097
;$COLUMNS=N,O,T,I,d,l,D
;
;   C:\Projects\BootloaderError.trc
;   Start time: 1/18/2019 08:43:19.653.0
;   Generated by PCAN-View v4.2.1.533
And here is the header from a typical .trc that I captured:

Code: Select all

;$FILEVERSION=1.1
;$STARTTIME=43487.4708017593
;
;   C:\Users\kyle\Workspace\old.trc
;
;   Start time: 1/22/2019 11:17:57.272.0
;   Generated by PCAN-View v4.2.0.514
I noticed two things. The FILEVERSION was different as was the PCAN-View version. So I downloaded the latest version of PCAN-View v4.2.1.533 and captured a new .trc. Here is the header from that trace:

Code: Select all

;$FILEVERSION=1.1
;$STARTTIME=43487.4710769676
;
;   C:\Users\kyle\Workspace\new.trc
;
;   Start time: 1/22/2019 11:18:21.050.0
;   Generated by PCAN-View v4.2.1.533

Digging deeper, I found the PEAK CAN TRC File Format document (https://www.peak-system.com/produktcd/P ... Format.pdf) which states that FILEVERSION 1.1 is for PCAN-View 3 and FILEVERSION 2.0 is for PCAN-View 4.

So why is it that when I'm using two separate version of PCAN-View 4 (v4.2.0.514 and v4.2.1.533) I receive .trc files in version 1.1? My customer has been sending me traces for month from PCAN-View v4.2.1.533 and they have always been in FILEVERSION 1.1. What could have changed that they are now being saved in FILEVERSION 2.0? I don't see any way to control this from within PCAN-View. Does it have to do with the driver or the adapter being used? What am I missing here?

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

Re: How to control TRC File Format

Post by PEAK-Support » Thu 24. Jan 2019, 09:52

Version 2.0 support the new CAN-FD Standard - see the changes info in the document

General:
  1. Comment lines prefixed with a semicolon will be ignored while loading Trace file, except $-keywords.
    Columns are separated with blanks.
    One message/warning/error per line.
    Supported protocols: CAN, CAN FD.
Changes compared to Version 1.3:
  1. 1) New $COLUMNS keyword. See ‘Columns’.
    2) CAN FD support.
    3) Separate Type and Direction (Rx/Tx) columns.
Your parser need to read always the header to check the File Version,and then you parse V1.x or V2.x

If your customer use a CAN2.0A/B USB Interface (IPEH-002021/002022 etc.) then the new PCAN-View will create Trace Files based on the V1.1. Only PCIe cards and new USB FD Devices will create the Version 2.x Trace files. Please ask your customer which Hardware he use - for me it looks like he use a PCI based card or a new CAN-FD USB.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

blipton
Posts: 17
Joined: Sat 11. Jul 2020, 02:22

Re: How to control TRC File Format

Post by blipton » Thu 23. Nov 2023, 18:46

I'm running into a very similar problem..

It seems the trc file captured using the Peak USB Can Adapter running PCAN-View 5.1.1.908 (which generates v1.1 trc files), is not compatible with the trc files expected by all the tools I've tried. For example, using karlding canlogconvert:
error: Expected Keyword ';$COLUMNS', found ';' (at char 47), (line:3, col:1)

In addition, first converting the v1.1 trc file to asc (using Peak-Converter) and then using that asc to convert to a log file (using python-can's can_logconvert).. the resulting log file won't work. For example, Log-CANverter and cantools report :
"invalidated line observed: '(76.811000) can0 016##01022334455060000 T'"
"Failed to parse line: '(76.580400) can0 016##01022334455060000 T'"

I understand PCAN-Explorer can save as v1.3, but is there any other can software (not canfd) that can save in a specific trc version and/or can convert between 1.1-1.3/2.0-2.1? Alternatively, are there example trc file versions that I can study and see how best to convert?

*
trc2csv : trc+dbc->asc,csv
karlding canlogconvert : trc->asc
python-can can_logconvert : asc->log
Log-CANverter : log+dbc to csv
cantools: plot log+dbc

blipton
Posts: 17
Joined: Sat 11. Jul 2020, 02:22

Re: How to control TRC File Format

Post by blipton » Thu 23. Nov 2023, 21:28

BTW, if I can't get these open source tools to play nice with the various trc, asc, log formats..

can I create a panel in PCAN-Explorer (gauges, leds), that open/replay any TRC file on that panel?

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

Re: How to control TRC File Format

Post by PEAK-Support » Fri 24. Nov 2023, 08:36

The PEAK Converter could convert between all TRC File Formats and also support ASC. If a TRC file could not be used with our tools, contact the software company that develop the Tool that create the TRC file - TRC is our own internal CAN Logger Format for raw CAN. If other company's use this format, they need to be sure that they follow our rules. A detailed files description of a PEAK-System TRC file, is available in our Support - Download section.
can I create a panel in PCAN-Explorer (gauges, leds), that open/replay any TRC file on that panel?
Please start a new Post in the correct section (PCAN-Explorer) - short answer - yes possible.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply