本页面提供的是上一版软件的文档。当前版本中已删除对应的英文页面。

访问 MDF 文件

以下示例说明如何打开 MDF 文件并访问有关该文件及其内容的信息。

打开 MDF 文件

通过指定目标文件的名称来打开 MDF 文件。有关该文件的许多基本详细信息已提供。此示例文件是使用 Vector CANape 创建的。

m = mdf('CANape.MF4')
m = 

  MDF with properties:

   File Details
                 Name: 'CANape.MF4'
                 Path: '\\central-mi\home\jpyle\documents\MATLAB\examples\vnt-ex51113426\CANape.MF4'
               Author: 'Otmar Schneider'
           Department: 'PMC @ Vector Informatik GmbH'
              Project: 'Demo'
              Subject: 'XCPSim'
              Comment: 'Example file created with Vector CANape'
              Version: '4.10'
             DataSize: 176545
     InitialTimestamp: 2016-04-21 14:27:17.000010629

   Creator Details
    ProgramIdentifier: 'MCD14.02'
              Creator: [1×1 struct]

   File Contents
           Attachment: [0×0 struct]
         ChannelNames: {2×1 cell}
         ChannelGroup: [1×2 struct]

查看文件创建详细信息

Creator 属性提供了有关创建该 MDF 文件的工具的信息。

m.Creator
ans = 

  struct with fields:

     VendorName: 'Vector Informatik GmbH'
       ToolName: 'CANape'
    ToolVersion: '14.0.20.2386'
       UserName: 'visosr'
        Comment: 'created'

查看通道组详细信息

MDF 文件中的数据存储在通道组中包含的通道中。此示例文件包含两个通道组。

m.ChannelGroup(1)
m.ChannelGroup(2)
ans = 

  struct with fields:

    AcquisitionName: '10 ms'
            Comment: '10 ms'
         NumSamples: 1993
           DataSize: 153461
             Sorted: 1
            Channel: [1×74 struct]


ans = 

  struct with fields:

    AcquisitionName: '100ms'
            Comment: '100ms'
         NumSamples: 199
           DataSize: 23084
             Sorted: 1
            Channel: [1×46 struct]

查看通道详细信息

通道组内存储了每个通道的详细信息。

m.ChannelGroup(1).Channel(1)
ans = 

  struct with fields:

                  Name: 'Counter_B4'
           DisplayName: ''
    ExtendedNamePrefix: 'XCPsim'
           Description: 'Single bit demo signal (bit from a byte shifting)'
               Comment: 'Single bit demo signal (bit from a byte shifting)'
                  Unit: ''
                  Type: FixedLength
              DataType: IntegerUnsignedLittleEndian
               NumBits: 1
         ComponentType: None
       CompositionType: None

快速访问通道名称

通过 ChannelNames 属性,可以快速访问以查找各个通道组中的特定通道。

m.ChannelNames
m.ChannelNames{1}
ans =

  2×1 cell array

    {74×1 cell}
    {46×1 cell}


ans =

  74×1 cell array

    {'Counter_B4'               }
    {'Counter_B5'               }
    {'Counter_B6'               }
    {'Counter_B7'               }
    {'PWM'                      }
    {'PWM_Level'                }
    {'PWMFiltered'              }
    {'Triangle'                 }
    {'map1_8_8_uc_measure[0][0]'}
    {'map1_8_8_uc_measure[0][1]'}
    {'map1_8_8_uc_measure[0][2]'}
    {'map1_8_8_uc_measure[0][3]'}
    {'map1_8_8_uc_measure[0][4]'}
    {'map1_8_8_uc_measure[0][5]'}
    {'map1_8_8_uc_measure[0][6]'}
    {'map1_8_8_uc_measure[0][7]'}
    {'map1_8_8_uc_measure[1][0]'}
    {'map1_8_8_uc_measure[1][1]'}
    {'map1_8_8_uc_measure[1][2]'}
    {'map1_8_8_uc_measure[1][3]'}
    {'map1_8_8_uc_measure[1][4]'}
    {'map1_8_8_uc_measure[1][5]'}
    {'map1_8_8_uc_measure[1][6]'}
    {'map1_8_8_uc_measure[1][7]'}
    {'map1_8_8_uc_measure[2][0]'}
    {'map1_8_8_uc_measure[2][1]'}
    {'map1_8_8_uc_measure[2][2]'}
    {'map1_8_8_uc_measure[2][3]'}
    {'map1_8_8_uc_measure[2][4]'}
    {'map1_8_8_uc_measure[2][5]'}
    {'map1_8_8_uc_measure[2][6]'}
    {'map1_8_8_uc_measure[2][7]'}
    {'map1_8_8_uc_measure[3][0]'}
    {'map1_8_8_uc_measure[3][1]'}
    {'map1_8_8_uc_measure[3][2]'}
    {'map1_8_8_uc_measure[3][3]'}
    {'map1_8_8_uc_measure[3][4]'}
    {'map1_8_8_uc_measure[3][5]'}
    {'map1_8_8_uc_measure[3][6]'}
    {'map1_8_8_uc_measure[3][7]'}
    {'map1_8_8_uc_measure[4][0]'}
    {'map1_8_8_uc_measure[4][1]'}
    {'map1_8_8_uc_measure[4][2]'}
    {'map1_8_8_uc_measure[4][3]'}
    {'map1_8_8_uc_measure[4][4]'}
    {'map1_8_8_uc_measure[4][5]'}
    {'map1_8_8_uc_measure[4][6]'}
    {'map1_8_8_uc_measure[4][7]'}
    {'map1_8_8_uc_measure[5][0]'}
    {'map1_8_8_uc_measure[5][1]'}
    {'map1_8_8_uc_measure[5][2]'}
    {'map1_8_8_uc_measure[5][3]'}
    {'map1_8_8_uc_measure[5][4]'}
    {'map1_8_8_uc_measure[5][5]'}
    {'map1_8_8_uc_measure[5][6]'}
    {'map1_8_8_uc_measure[5][7]'}
    {'map1_8_8_uc_measure[6][0]'}
    {'map1_8_8_uc_measure[6][1]'}
    {'map1_8_8_uc_measure[6][2]'}
    {'map1_8_8_uc_measure[6][3]'}
    {'map1_8_8_uc_measure[6][4]'}
    {'map1_8_8_uc_measure[6][5]'}
    {'map1_8_8_uc_measure[6][6]'}
    {'map1_8_8_uc_measure[6][7]'}
    {'map1_8_8_uc_measure[7][0]'}
    {'map1_8_8_uc_measure[7][1]'}
    {'map1_8_8_uc_measure[7][2]'}
    {'map1_8_8_uc_measure[7][3]'}
    {'map1_8_8_uc_measure[7][4]'}
    {'map1_8_8_uc_measure[7][5]'}
    {'map1_8_8_uc_measure[7][6]'}
    {'map1_8_8_uc_measure[7][7]'}
    {'map1_8_8_uc_measure'      }
    {'t'                        }