logo资料库

MDF格式分析.doc

第1页 / 共36页
第2页 / 共36页
第3页 / 共36页
第4页 / 共36页
第5页 / 共36页
第6页 / 共36页
第7页 / 共36页
第8页 / 共36页
资料共36页,剩余部分请下载后查看
Format Specification MDF Format Version 3.0 1 15.11.02
Revision History: Date 03/10/2000 03/12/2001 05.02.2002 29.07.2002 01.08.2002 19.08.2002 Version Contents 1.0 1.3 1.4 1.5 1.6 2.0 Technical documentation of current status Several corrections Data type “String” and “Byte Array” added. Conversion formulas “ASAP2 Rational Conversion formula”, “ASAP2 Textual Conversion formula”, “ASAP2 Text table Conversion formula”, “Date”, “Time” added. Implementation hints removed. Several corrections minor editorial changes enhancements: support for COMPU_VTAB_RANGE (CCBLOCK) display identifier in CNBLOCK additional byte offset in CNBLOCK 04.09.2002 14.11.2002 2.1 2.2 review with Vector updated description of record sorting based on time 2 15.11.02
Table of Contents 1. INTRODUCTION 1.1. Scope of This Document 1.2. Conventions 1.3. Abbreviations 1.4. Outline 2. MDF VERSION HANDLING 2.1. Rules to Ensure MDF Compatibility between Versions 3. MDF GENERAL BLOCK FORMAT 3.1. Definition of Data Types Used 3.2. Overview of Block Types Used 3.3. The File Identification Block IDBLOCK 3.3.1. 3.3.2. Block Structure of IDBLOCK Example of IDBLOCK 3.4. The Header Block HDBLOCK 3.4.1. 3.4.2. Block Structure of HDBLOCK Example of HDBLOCK 3.5. The Text Block TXBLOCK 3.5.1. 3.5.2. Block Structure of TXBLOCK Example of TXBLOCK 3.6. The Program-Specific Block PRBLOCK 3.6.1. 3.6.2. Block Structure of PRBLOCK Example of PRBLOCK 3.7. The Data Group Block DGBLOCK Block Structure of DGBLOCK Example of DGBLOCK 3.7.1. 3.7.2. 3.8. The Channel Group Block CGBLOCK 3.8.1. 3.8.2. Block Structure of CGBLOCK Example of CGBLOCK 3.9. The Channel Block CNBLOCK 3.9.1. 3.9.2. Block Structure of CNBLOCK Example of CNBLOCK 3.10. The Channel Conversion Block CCBLOCK 3.10.1. Block Structure of CCBLOCK 3.10.2. CCBLOCK – Parametric, Linear 3.10.3. CCBLOCK – Polynomial Function With 6 Parameters 3.10.4. CCBLOCK – Tabular, With Interpolation 3.10.5. CCBLOCK – Tabular 5 5 5 5 5 6 6 7 8 8 8 8 9 9 9 9 10 10 10 11 11 11 12 12 12 13 13 13 15 15 15 21 21 21 21 22 22 3 15.11.02
3.10.6. CCBLOCK – Exponential 3.10.7. CCBLOCK – Logarithmic 3.10.8. CCBLOCK - ASAP2 Rational conversion formula 3.10.9. CCBLOCK - ASAP2 Text formula 3.10.10. 3.10.11. 3.10.12. 3.10.13. 3.10.14. CCBLOCK – ASAM-MCD2 Text Table CCBLOCK – ASAM-MCD2 Text Range Table CCBLOCK - Data Structure Date CCBLOCK - Data Structure Time Example of CCBLOCK 4. MDF DATA FORMAT 4.1. Data Format for Sorted Writing 4.2. 4.3. Example 1 of Data Blocks Example 2 of Data Blocks 4.4. Data Format for Unsorted Writing 5. APPENDIX 22 23 23 24 24 24 25 25 25 28 28 28 31 31 33 4 15.11.02
Introduction 1. For recording, exchanging, and post-measurement analysis, the Measure Data Format (MDF) is well established in the automotive industry. The MDF format provides    exchange between a number of tools in the automotive industry compact description of data fast access to general file info independent of the file length 1.1. Scope of This Document This document serves to specify MDF version 3.0. 1.2. Conventions 1.3. CCBLOCK CGBLOCK CNBLOCK DGBLOCK HDBLOCK IDBLOCK MDF NIL PRBLOCK TXBLOCK Abbreviations Channel Conversion BLOCK Channel Group BLOCK ChanNel BLOCK Data Group BLOCK HeaDer BLOCK IDentification BLOCK Measure Data Format NIL pointer (0x00000000) PRogram BLOCK TeXt BLOCK 1.4. Outline Chapter 2 describes the conventions for extending and updating the format. Chapter 3 describes the structure of the MDF file and the various block types. Chapter 4 describes how data is written, i.e. sorted or unsorted. Chapter 5 (Appendix) shows the hex dump of an actual MDF file. 5 15.11.02
2. MDF Version Handling The MDF version consists of a major version number and a minor version number, e.g. V3.0 has the major version number “3” and the minor version number “0”. minor version number major version number Changes in the MDF file that may not result in a misinterpretation of the data may be done by only changing the minor version number. Changes in the MDF format that may result in a misinterpretation of the data require a change of the major version number. A tool that evaluates the MDF file may generate a warning or error message when reading a MDF file that has a higher major version number than what is supported by the tool. 2.1. Rules to Ensure MDF Compatibility between Versions To ensure a high degree of compatibility, new entries are only appended to the blocks. This implies the following consequences for the evaluation tool: 1. If a tool detects a block that has a smaller block length than expected by the version supported by the tool, the additional fields are set to their default values. This is the case, if the tool supports a later MDF version than the file is encoded in. If the tool detects a block that has a larger block length than expected by the version supported by the tool, the additional fields are ignored. This is the case, if the tools supports a previous MDF version compared to the one the file is encoded with. In this case, the tool may interpret the measurement data in the file incorrectly; thus the MDF major version number has to be increased when introducing such a change. 2. 6 15.11.02
3. MDF General Block Format The MDF file is composed of a series of data blocks. The blocks include pointers to each other that are stored in data of type LINK. A link is a relative byte position within the file, starting at the beginning of the file. The file always starts with the file identifier IDBLOCK. The file header HDBLOCK follows at byte position 64. All other blocks are exclusively linked with each other via LINKs. With the exception of the IDBLOCK, the “Block Size” field indicates the size of each block. To ensure upward compatibility, the block sizes specified in this document should be considered the minimum block sizes in each case. The following figure gives an overview of the general block structure of an MDF file: file identification IDBlock file header HDBlock measurement file comment TXBlock program specific data PRBlock Data records 1 data group 1 DGBlock channel group 1.1 CGBlock channel 1.1.1 CNBlock Channel 1.1.2 CNBlock channel comment TXBlock unique identifier TXBlock conversion rule CCBlock channel group 1.2 CGBlock channel 1.2.1 CNBlock channel comment TXBlock channel 1.2.2 CNBlock long name TXBlock conversion rule CCBlock Data records 2 data group 2 DGBlock channel group 2.1 CGBlock channel 2.1.1 CNBlock channel comment TXBlock channel 2.1.2 CNBlock unique identifier TXBlock conversion rule CCBlock figure 1: MDF file block structure and linkage 7 15.11.02
The specification also shows an example of each block type. The HEX dump of the entire sample file is included in the attachment. 3.1. Data Type CHAR UINT8 UINT16 UINT32 BOOL REAL LINK Definition of Data Types Used Format 1 byte representing a character (C data type: char). The storage of character strings may or may not be terminated by a zero byte. 8-bit unsigned integer 16-bit unsigned integer 32-bit unsigned integer Boolean variable, stored as 16-bit value If contents != 0 then TRUE, if contents == 0 then FALSE Floating-point compliant with IEEE 754, double precision (64 bits) 32-bit signed integer, used as byte position within the file. If a LINK is nil (corresponds to 0), this means the LINK cannot be de-referenced. 3.2. Overview of Block Types Used Block Type IDBLOCK HDBLOCK TXBLOCK PRBLOCK DGBLOCK CGBLOCK CNBLOCK CCBLOCK Description Identification block Header block Text block Program block Data group block Channel group block Channel block Channel conversion block Purpose Identification of the file as MDF file General description of the measurement file Contains a String with variable length Contains proprietary data of the application generating the MDF file Description of data block that may refer to one or several channel groups Description of a channel group, i.e. signals which are always measured jointly Description of a channel Description of a conversion formula for a channel 3.3. The File Identification Block IDBLOCK The IDBLOCK always begins at file position 0. It contains information to identify the file. This includes information about the source of the file and general format specifications. 3.3.1. Block Structure of IDBLOCK Numbe r 8 8 8 1 1 1 1 2 30 Data Type CHAR CHAR CHAR UINT16 UINT16 UINT16 UINT16 CHAR CHAR 8 Description ” File identifier, always contains “MDF “. (“MDF” followed by five spaces) Format identifier, a textual representation of the format version for display, e.g. “3.00 Program identifier, to identify the program which generated the MDF file Byte order 0 = Little endian Floating-point format used 0 = Floating-point format compliant with IEEE 754 standard Version number of the MDF , i.e. 300 for this version Reserved Reserved Reserved 15.11.02
分享到:
收藏