MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (2024)

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (1)

What is an MF4 file (aka MDF4) - and why is it key to CAN bus data logging?

The ASAM MDF (Measurement Data Format) is a binary file format for recording e.g. CAN, CAN FD and LIN bus data. Today, the MDF format is the industry standard - ensuring interoperability across many CAN tools.

The CANedge supports the latest MF4 file format - and below we list benefits, basics and software/API tools. We also provide sample MF4 data (J1939, OBD2).


In this article

  1. What is ASAM MDF?
  2. 6 key benefits of MF4
  3. MF4 file structure

Author: Martin Falch

(updated April 2022)


What is ASAM MDF?

MDF was developed in the 90's by Vector GmbH and Robert Bosch GmbH. Initially it was proprietary, but in 2002 it was made public - and in 2009 it was standardized by ASAM. The latest version, MDF 4.11, was released in 2014.

Today, the MDF file format is the de facto industry standard - and it is used in an extensive suite of CAN software, APIs - and hardware like the CANedge1, CANedge2 and CANedge3.


6 key benefits of MF4

Logging data as MDF4 files has several major benefits:

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (3) INTEROPERABLE

MDF is open, standardized & widely supported for CAN bus logging - ensuring interoperability across many tools, software and APIs

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (4) FAST WRITING

Logging CAN data is a challenge due to increasing data rates. MDF is designed for fast writing - enabling lossless recording of e.g. CAN FD

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (5) FAST READING

The binary MDF is index based and extremely fast to read, edit or e.g. DBC convert - making it ideal for databases and big data analytics

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (6) COMPRESSIBLE

MDF 4.1 supports compression, reducing file size drastically. This improves SD capacity, server costs & 3G/4G upload costs

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (7) RAW/PHYSICAL

MDF4 supports both "raw" bus logging and "physical" values - hence you can often use the same software/ APIs

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (8) SOFTWARE/API

The format is supported by free powerful . It's e.g. easy to DBC convert MDF4 data and export it to CSV, MATLAB, pandas

These features make MDF ideal for e.g. cloud analytics and telematics - across CAN, CAN FD, LIN, J1939, OBD2, CANopen, NMEA 2000 and more.

MF4 file structure

In this section, we provide a quick overview of the basic MDF4 file structure - with outset in a CANedge2 raw CAN bus log file.

MDF4 files are comprised of "blocks" - most of which are in practice arbitrarily ordered. Via a system of internal "links", these blocks form a hierarchy.

This structure enables more flexible log files vs. e.g. CSV - ideal for e.g. mixing CAN, CAN FD & LIN or supporting both raw/physical data.

For technical details on MDF files, expand the below:


MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (10)

To visualize the MDF4 hierarchy in practice, we can take outset in a raw CAN bus log file. In the screenshot, we've used Vector's free MDF Validator tool to load a raw J1939 MDF4 log file (*.MF4) from the CANedge2.

This is in general a useful tool for understanding the basic structure of MDF files - and checking their validity.


As evident from the above, there are several key MDF blocks:

Block Description
Identification (ID) 64 bytes block at the beginning of an MDF. Identifies file as MDF and specifies version
Header (HD) Adds info after ID (e.g. log start time). Acts as file root and links to each Data
File History (FH) Describes tools involved in creating the file (incl. e.g. the CANedge FW version)
Data Group (DG) Contains measurement data incl. Data Blocks and Channel Groups
Data (DT) Contains records (e.g. CAN frames). The CANedge stores all raw data in one DT
Channel Group (CG) Describes the layout of records. The CANedge uses 8 CGs (2 per CAN/LIN channel)
Channel (CN) A Channel Group contains channels that describe the data structure and signals

Note: MDF "channels" should not be confused with "bus channels" (the CANedge e.g. has 2 x CAN and 2 x LIN "bus channels").

If you're logging raw CAN bus data via "bus channel" 1 on the CANedge, the data will be stored in Channel Group 1 and 2. Here, CG 2 enables the use of variable data length (necessary for e.g. CAN FD).

Within CG 1, you'll see the CN CAN_DataFrame. This is split in 7 parts/sub channels:

  1. BusChannel: The bus channel that the data is from
  2. ID: The CAN ID
  3. IDE: The ID type (regular, extended)
  4. DLC: The CAN frame DLC
  5. DataLength: The actual data length (may differ from the DLC for CAN FD)
  6. DataBytes: The data bytes of the CAN frame
  7. Dir: The direction (received, transmitted)

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (11)


The CANedge writes log files as MDF 4.11 using the 'bus logging' concept to create log files with raw CAN/LIN data.

To ensure fast writing, the CANedge appends every new CAN/LIN frame to a single Data Block. This results in an "unsorted" MDF file. To enable fast reading in e.g. your API processing you may choose to sort the MDF file before/during processing. Doing so in advance is not required (as most tools support unsorted MDFs) - but it enables fast indexing and hence faster processing.


If you sort a raw CANedge log file using e.g. the asammdf GUI/API, you'll note that the resulting MDF file is structured differently from before - see the MDF Validator example.

Instead of one Data Group, there is now a Data Group for each bus channel.

Further, there are no longer two Channel Groups per bus channel. Instead, there's a single Channel Group with two Data blocks (contained in a Data List).

This structure ensures that each Data Group contains Data blocks with records of identical layout - enabling fast index based reading.

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (12)

In some cases you may want to trigger a small "sorting" script everytime a new raw log file is uploaded to your S3 server. This way you can store only sorted files on your server - enabling faster reading/processing of the files when needed.

You can also take this a step further and automatically DBC convert your raw MDF log files as they come into your server. This process will include the sorting step and enable you to directly fetch human-readable data for e.g. plots. For examples of how to sort and/or DBC convert your MDF data, see our API sample library and the examples below.


The below links can be useful in order to gain a further understanding of MDF:


Raw vs. physical (human readable) MDF4 data

When you connect the CANedge to your car, truck or other CAN/LIN application, you'll record raw bus data.

To work with the data, you'll need to convert it to human-readable data - aka "physical" or "scaled" values.

In order to convert your raw MDF files, you'll need a database of conversion rules - e.g. a DBC file (CAN database).

With a DBC, you can use e.g. asammdf (see below) to convert your raw data. The resulting MDF file contains a Data Group for each CAN ID and a Channel for each message signal.

You can then easily plot the decoded data in e.g. asammdf - or export it to csv/mat for analysis in Excel/MATLAB.

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (13)


MDF4 software & API tools

So how do you actually manage your CAN bus MDF4 log files?

Below we list examples of software/APIs that you can use to manage your MDF4 data.

TIP: If you're new to MDF, we recommend the open source asammdf GUI/API and the simple MDF4 converters to get started.

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (14)


asammdf (GUI)

MF4 converters

MF4 decoders

CANedge Python API

MDF Validator

HBM tools

asammdf (API)

VNT (MATLAB APIs)

Other

asammdf (GUI)

The open source asammdf offers a simple-to-use GUI for ad hoc reading, editing, DBC conversion and plotting of MDF files

  • Raw/converted MDFs
  • Concatenate, resample
  • DBC convert (J1939, OBD2)
  • Graphical plots
  • Export (CSV, MATLAB, ...)
  • 100% open source
  • Windows/Linux support

Learn more

MF4 converters

Our free open source MF4 converters let you easily convert raw CANedge data to popular formats:

  • Output: ASC, TRC, CSV, ...
  • Finalize & sort MDF4 files
  • Drag & drop + CLI
  • Easily use in scripts
  • 100% open source
  • Windows/Linux support

Learn more

MF4 decoders

Our free open source MF4 decoders let you easily DBC decode raw CANedge data to popular formats:

  • Output: DBC decoded CSV, Parquet
  • Finalize & sort MDF4 files
  • Drag & drop + CLI
  • Easily use in scripts
  • 100% open source
  • Windows/Linux support

Learn more

CANedge MF4 Python API

We provide an open source MF4 Python API:

  • List MF4 log files (local/S3)
  • Easily load MF4 log files
  • Iterate or load into pandas
  • DBC decoding
  • Example script library
  • 100% open source
  • Windows/Linux support
  • Dashboard integration

Python API intro

MDF Validator

This free MDF viewer from Vector lets you load raw/converted MDF files to view the structure and evaluate validity. Useful for understanding the MDF file.

  • 100% free (requires your details)
  • Windows support
  • View MDF structure & meta info
  • Check the validity of an MDF file
  • Load raw & converted MDF files

Learn more

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (15)

Vector Tools (CANalyzer)

CANalyzer natively supports finalized & sorted MDF4 files.

  • License based
  • Comprehensive analysis tool
  • Advanced graphical plots
  • Load raw & converted MDF files

CANalyzer details

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (16)

HBM Tools (nCode)

The nCode software is popular within equipment analysis, e.g. for durability testing and big data visualization.

  • License based
  • Comprehensive analysis tool
  • Advanced graphical plots
  • Load raw & converted MDF files

nCode details

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (17)

asammdf (Python API)

The API behind the asammdf GUI tool provides a full suite of all the core operations you need to process both raw and converted MDF files at scale.

  • 100% free & open source
  • Load raw & converted MDF files
  • Concatenate, filter, resample, ...
  • DBC conversion (incl. J1939, OBD2)
  • Extremely fast processing
  • Graphical plots
  • Export (CSV, pandas, MAT, HDF5, ...)
  • Easily combine with S3 boto3 API

asammdf intro | API examples

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (18)

Vehicle Network Toolbox (MATLAB API)

MATLAB provides a powerful toolbox for analysis of MDF4 data with focus on automotive use cases

  • License based MDF import
  • Load finalized & converted MDF files
  • DBC conversion
  • Efficient handling of large files
  • Powerful plot functionality
  • Work directly with files on S3

VNT intro

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (19)

Other

There are many more MDF software tools available for use with the MDF file format. Examples include tools from dSpace (AutomationDesk, ControlDesk), ETAS (ASCMO, INCA) and many more.

ASAM MDF software directory

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (20)


Example: J1939 MF4 data (tractor)

The CANedge is excellent for use with heavy duty vehicles.

In particular it's ideal for vehicle fleet telematics across e.g. trucks, transit buses, excavators, tractors.

The asammdf GUI/API supports decoding J1939 data via J1939 DBC files. To test this, download the sample data below (*.MF4 & DBC) and load it in the asammdf GUI.

J1939 telematics Sample data J1939 DBC

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (21)

Example: OBD2 MF4 data (Audi A4)

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (22)

Another popular use case is recording OBD2 data from cars.

Most cars support OBD2 data, letting you analyze e.g. speed, fuel consumption, brake patterns and diagnostics.

A challenge with OBD2 can be in converting the raw data. However, this is easily done with asammdf and our OBD2 DBC. Try it out via the sample files below:

OBD2 logging Sample data OBD2 DBC

Ready to log your CAN/LIN data in the MF4 format?

Get your CANedge today!

Buy now Contact us


Recommended for you


CANEDGE2 - PRO CAN IoT LOGGER

asammdf GUI/API - PROCESS CAN DATA

SIMPLE-TO-USE MDF4 CONVERTERS


Use left/right arrows to navigate the slideshow or swipe left/right if using a mobile device

MF4 (MDF4) Explained - A Simple Intro [+J1939/OBD2 Data] (2024)

FAQs

What is the MF4 data format? ›

What is an MF4/MDF4 file? Measurement Data Format version 4 (MDF 4) is a standard file format by ASAM used by the automotive industry for storing measurement data in binary file format. It records CAN, CAN FD, LIN bus data, sensor data from an engine control unit (ECU), offering interoperability across many CAN tools.

What is the format of ASAM MDF4? ›

An ASAM MDF file (file extension: *. mf4) is organized in binary blocks where each block consists of a number of contiguous bytes that can be seen as a record or structure of data fields. There are different types of blocks, and the block type defines the block's purpose and content.

How to view MF4 file? ›

Remember, different programs may use MF4 files for different purposes , so you may need to try out a few of them to be able to open your specific file. Try a universal file viewer like Bitberry File Opener. It can open 410 different types of files - and most likely yours too.

How to install asammdf in python? ›

Installation (Linux)
  1. Install Python 3.9.13 for Linux [1]
  2. Open your command prompt and write: pip install -I asammdf[gui]
  3. Open your start menu, write 'asammdf' and open the GUI via the asammdf icon.

How to read data from MDF file? ›

SSMS Method to Learn How to Extract MDF File & View All Data
  1. Open SSMS in system & connect with SQL instance.
  2. Navigate to Object Explorer & right-click on databases.
  3. Now, Go to Attach & Click on Add button in the window.
  4. Browse to Select the MDF file from the system & Click Ok.
Jan 18, 2024

What file type is MDF? ›

MDF (Measurement Data Format) is a binary file format to store recorded or calculated data for post-measurement processing, off-line evaluation or long-term storage. The format has become a de-facto standard for measurement & calibration systems (MC-systems), but is also used in many other application areas.

How to use a MDF file? ›

5 Quick Steps for MDF File Opener
  1. Step-1. Launch Tool to Open MDF File of SQL in System.
  2. Step-2. Add MDF File using the Add File Button.
  3. Step-3. Select Quick or Advance Scan Option.
  4. Step-4. Open and View MDF Files in System.
  5. Step-5. Close the MDF File Opener Finally.
Sep 2, 2024

How to convert mdf file to iso? ›

Step 1: Download the PowerISO in your system and from “Tool,” click on the “Convert” button. Step 2: Choose the source file you want to change and choose the output file format to iso file. Step 3: Tap on the “o*k” button to start and wait for a message, “Converting image file completes successfully.”

What format is MDF logging? ›

MDF Logging Files (MF4, MDF)

Stores the data in binary format in a very efficient way in terms of file size and read/write performance. Supports CAN, LIN, FlexRay and Ethernet in standard ASAM format.

How do I find an MDF file? ›

Default location of MDF file in SQL server. Files that are common and used by all instances on a single system are installed inside the folder :\Program Files\Microsoft SQL Server\nnn\.

Where is the master MDF file? ›

The msdb database file (msdb. mdf) and msdb log files (msdb. ldf) are located in the Program Files\Microsoft SQL Server\Mssql\Data directory. Due to the amount of configuration information stored in the msdb database, the database should be routinely backed up.

Can Matlab read a MDF file? ›

The toolbox provides read and write access to MDF files.

How to read a mdf file in Python? ›

Create a Python file example.py with the following code to read your MDF file. Don't forget to replace the example file paths with the actual ones. print 'Conversion result successfully written to /tmp/output.

How to install Python commands? ›

Python Installation on Windows
  1. Step 1: Select Python Version. ...
  2. Step 2: Download Python Executable Installer. ...
  3. Step 3: Run Executable Installer. ...
  4. Step 4: Add Python to Path (Optional) ...
  5. Step 5: Verify Python Was Installed on Windows. ...
  6. Step 6: Verify PIP Was Installed. ...
  7. Step 7: Install virtualenv (Optional)
Dec 5, 2023

What is MF file type? ›

What is an MF file? A file with . mf extension is a Java Manifest file that contains information about the individual JAR file entries. The MF file itself is contained inside the JAR file and provides all the extension and package-related definition.

What is the format of PDS4 data? ›

PDS4 files are compose of a . xml (label) file which references a raw imagery file. The driver also supports imagery stored in a separate uncompressed GeoTIFF file with a strip organization compatible of a raw imagery file.

What is the file format for mass spec data? ›

mzXML. mzXML is a XML (eXtensible Markup Language) based common file format for proteomics mass spectrometric data.

What is the file format of master database? ›

A file with . mdf extension is a Master Database File used by Microsoft SQL Server to store user data. It is of prime importance as all the data is stored in this file.

References

Top Articles
Level 1 Antiterrorism Awareness Training Pretest
Monkey Farm Game Poki
Methstreams Boxing Stream
Cooking Chutney | Ask Nigella.com
25X11X10 Atv Tires Tractor Supply
Triumph Speed Twin 2025 e Speed Twin RS, nelle concessionarie da gennaio 2025 - News - Moto.it
Brgeneral Patient Portal
Emmalangevin Fanhouse Leak
Paula Deen Italian Cream Cake
Devourer Of Gods Resprite
Blue Ridge Now Mugshots Hendersonville Nc
Slmd Skincare Appointment
Bros Movie Wiki
What to do if your rotary tiller won't start – Oleomac
Enderal:Ausrüstung – Sureai
Restaurants Near Paramount Theater Cedar Rapids
What is Rumba and How to Dance the Rumba Basic — Duet Dance Studio Chicago | Ballroom Dance in Chicago
Iu Spring Break 2024
Golden Abyss - Chapter 5 - Lunar_Angel
Lost Pizza Nutrition
Macu Heloc Rate
Apparent assassination attempt | Suspect never had Trump in sight, did not get off shot: Officials
Random Bibleizer
Table To Formula Calculator
Lbrands Login Aces
1636 Pokemon Fire Red U Squirrels Download
Shiny Flower Belinda
Babydepot Registry
Kleinerer: in Sinntal | markt.de
Six Flags Employee Pay Stubs
Boondock Eddie's Menu
Luciipurrrr_
RUB MASSAGE AUSTIN
T&J Agnes Theaters
Metro By T Mobile Sign In
Watchseries To New Domain
Dadeclerk
Lyca Shop Near Me
Evil Dead Rise (2023) | Film, Trailer, Kritik
The Closest Walmart From My Location
Indiana Jones 5 Showtimes Near Cinemark Stroud Mall And Xd
VDJdb in 2019: database extension, new analysis infrastructure and a T-cell receptor motif compendium
Sofia Franklyn Leaks
Top 40 Minecraft mods to enhance your gaming experience
Sour OG is a chill recreational strain -- just have healthy snacks nearby (cannabis review)
Craigslist Pet Phoenix
Cult Collectibles - True Crime, Cults, and Murderabilia
Stitch And Angel Tattoo Black And White
The Pretty Kitty Tanglewood
Boyfriends Extra Chapter 6
Subdomain Finer
One Facing Life Maybe Crossword
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 5581

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.