MDF4 File Format

MDF Overview

Measurement Data Format version 4 (MDF 4) is a standard file format used by the automotive industry for storing measurement data in binary file format.Following blocks are supported.

  • ID block

  • Header block

  • Meta data block

  • File History block

  • Channel block

  • Channel group block

  • Data group block

  • DT block

Block Sections

Each block has three sections.

  • Header section

  • Link section

  • data section

Block Types

ID Block (ID)

Identification block is used to identify the file as an mdf4 file.It has MDF version and program Identification. This is the only block that has no general block header.IDblock are the only block types which occur only once and which have a fixed position in the MDF file.

Header Block (HD)

Header block defines the general description of measurement of a file. Header block is used to set the offset of following data group offset,channel group offset, and header text comment and set the start time in nano seconds.HD block are the only block types which occur only once and which have a fixed position in the MDF file.

Meta Data Block (MD)

Meta data block is a block which has a container for an XML string of variable length.

File history block (FH)

This block contains file time in nanoseconds and has file history text comment.

Channel Block (CN)

It contains channels that describes data structure and signals, i.e information about the measured signals and hwo the signal values are stored.

Channel Group Block (CG)

Describes the layout of records,i.e channels which are always measured jointly.

Data Group block (DG)

Contains description of the data block that may refer to one or more channel groups,measurement data including data blocks and channnel groups

Data Block (DT)

It contains data records with signal values (e.g CAN frames)

Refer to the MDF Demo page for an example about how the RAPIDSEA uses the mdf file format.

Application Interface

MDF4 calls

Function

Description

rs_mdf4_init

Function to open the mdf4 logging system

rs_mdf4_set_file_info

Function to sets the file path and name for MDF4 logging.

rs_mdf4_set_compression

Function to sets the compression level for MDF4 logging.

rs_mdf4_set_prog_identity

Function to sets the program identity for MDF4 logging.

rs_mdf4_data_log

Function to Logs CAN data into the MDF4 system.

rs_mdf4_default_blks

Function to initializes the default blocks for MDF4 logging.

Error Code

  • Every API’s for the mdf returns some success or failure values. Please refer below section,

MDF4 Header Details

Documentation from the relevant header as follows:

Warning

doxygenfile: Cannot find file “rs_mdf.h