DiagnosticTool.Utilities.CANoeTraceFileHelper 0.1.1

dotnet add package DiagnosticTool.Utilities.CANoeTraceFileHelper --version 0.1.1
                    
NuGet\Install-Package DiagnosticTool.Utilities.CANoeTraceFileHelper -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DiagnosticTool.Utilities.CANoeTraceFileHelper" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiagnosticTool.Utilities.CANoeTraceFileHelper" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="DiagnosticTool.Utilities.CANoeTraceFileHelper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DiagnosticTool.Utilities.CANoeTraceFileHelper --version 0.1.1
                    
#r "nuget: DiagnosticTool.Utilities.CANoeTraceFileHelper, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DiagnosticTool.Utilities.CANoeTraceFileHelper@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DiagnosticTool.Utilities.CANoeTraceFileHelper&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=DiagnosticTool.Utilities.CANoeTraceFileHelper&version=0.1.1
                    
Install as a Cake Tool

CANoeTraceFileHelper

对 Vector CANoe 软件 Trace 模块导出的文件进行解析。

支持的格式:

  • ASCII Logging File
    • Error Frame 信息
    • Error Status 信息
    • CAN Bus 帧
    • CAN FD Bus 帧
    • 其他
  • XML Logging File
  • 其他

ASCII Logging File

待解析文件内容示例

date Fri Jul 25 04:55:53.791 pm 2025
base hex  timestamps absolute
internal events logged
// version 12.0.0
// Measurement UUID: 9796bb1a-672a-441d-8a04-c52cd2b50ffc
   0.000015 CAN 1 Status:chip status error active
   0.000016 CAN 2 Status:chip status error active
   1.000641 CAN 1 Status:chip status error active
   1.000642 CAN 2 Status:chip status error active
   1.881099 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x20aa	Code = 0x82	ID = 0x12b	DLC = 7	Position = 47	Length = 95125	Data = 0x6d  0xb6  0xd1  0  0xc2  0xe7  0
   2.000447 CAN 1 Status:chip status error active
   2.000448 CAN 2 Status:chip status error active
   3.000303 CAN 1 Status:chip status error active
   4.573349 1  A0                                  Rx   d 0  Length = 89900 BitCount = 49 ID = 160
   5.183936 1  A8                                  Rx   d 8 00 01 02 03 04 05 06 07  Length = 235904 BitCount = 122 ID = 168
   5.685977 1  15A                                 Rx   d F 00 01 02 03 04 05 06 07  Length = 237892 BitCount = 123 ID = 346
   6.296610 1  15B                                 Rx   r F  Length = 91899 BitCount = 50 ID = 347
   6.873774 1  A8x                                 Rx   d 8 00 01 02 03 04 05 06 07  Length = 281879 BitCount = 145 ID = 168x
   7.446464 1  B8x                                 Rx   r 8  Length = 135883 BitCount = 72 ID = 184x
   8.243202 CANFD   1 Tx         d4x                                  0 0 8  8 00 00 00 00 00 00 00 00   318047  162   301040 c8009c7b 46500250 4b280150 20011736 2000091c
  11.013716 CANFD   1 Tx         d5                                   0 0 8  0    88044   47   200050     6130 46500250 4b280150 20011736 2000091c
  11.167678 CANFD   1 Tx         d5                                   0 0 8  0    88059   47   200050     6130 46500250 4b280150 20011736 2000091c
  13.758856 CANFD   2 Tx         d6x                                  1 0 f 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   424063  704   303040 98166481 46500250 4b280150 20011736 2000091c
  14.029772 CANFD   2 Tx         d6x                                  1 0 f 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   424047  704   303040 98166481 46500250 4b280150 20011736 2000091c
 146.936542 CANFD   1 Tx         d1                                   0 0 8  8 00 00 00 00 00 00 00 00   242062  124   200040     424a 46500250 4b280150 20011736 2000091c
 152.753626 CANFD   1 Tx         d2                                   0 0 8  8 00 00 00 00 00 00 00 00   272063  139   301040 f801e33c 46500250 4b280150 20011736 2000091c
 153.472869 CANFD   1 Tx         d3                                   1 0 8  8 00 00 00 00 00 00 00 00   107047  139   303040 f8013c75 46500250 4b280150 20011736 2000091c
 155.023897 CANFD   1 Tx         d4x                                  0 0 8  8 00 00 00 00 00 00 00 00   318047  162   301040 c8009c7b 46500250 4b280150 20011736 2000091c
 156.121601 CANFD   1 Tx         d5                                   0 0 8  0    88059   47   200050     6130 46500250 4b280150 20011736 2000091c
 157.127364 CANFD   2 Tx         d6x                                  1 0 f 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   424046  704   303040 98166481 46500250 4b280150 20011736 2000091c
            

解析代码示例

using DiagnosticTool.Utilities.CANoeTraceFileHelper.AscLoggingFile;

var file = """
    date Fri Jul 25 04:55:53.791 pm 2025
    base hex  timestamps absolute
    internal events logged
    // version 12.0.0
    // Measurement UUID: 9796bb1a-672a-441d-8a04-c52cd2b50ffc
    0.000015 CAN 1 Status:chip status error active
    0.000016 CAN 2 Status:chip status error active
    1.000641 CAN 1 Status:chip status error active
    1.000642 CAN 2 Status:chip status error active
    1.881099 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x20aa	Code = 0x82	ID = 0x12b	DLC = 7	Position = 47	Length = 95125	Data = 0x6d  0xb6  0xd1  0  0xc2  0xe7  0
    2.000447 CAN 1 Status:chip status error active
    2.000448 CAN 2 Status:chip status error active
    3.000303 CAN 1 Status:chip status error active
    4.573349 1  A0                                  Rx   d 0  Length = 89900 BitCount = 49 ID = 160
    5.183936 1  A8                                  Rx   d 8 00 01 02 03 04 05 06 07  Length = 235904 BitCount = 122 ID = 168
    5.685977 1  15A                                 Rx   d F 00 01 02 03 04 05 06 07  Length = 237892 BitCount = 123 ID = 346
    6.296610 1  15B                                 Rx   r F  Length = 91899 BitCount = 50 ID = 347
    6.873774 1  A8x                                 Rx   d 8 00 01 02 03 04 05 06 07  Length = 281879 BitCount = 145 ID = 168x
    7.446464 1  B8x                                 Rx   r 8  Length = 135883 BitCount = 72 ID = 184x
    8.243202 CANFD   1 Tx         d4x                                  0 0 8  8 00 00 00 00 00 00 00 00   318047  162   301040 c8009c7b 46500250 4b280150 20011736 2000091c
    11.013716 CANFD   1 Tx         d5                                   0 0 8  0    88044   47   200050     6130 46500250 4b280150 20011736 2000091c
    """

var canAscFile = new CanAscLoggingFileHelper.CanAscLoggingFile(file);  // 逐行解析,解析错误时跳过,并将解析失败的行内容输出到控制台

var fileContent = canAscFile.WriteToText();  // 按照 CANoe ASCII Logging File 格式输出为文本
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 244 8/5/2025
0.1.0.1-beta.1 120 7/28/2025
0.1.0-beta.1 122 7/28/2025