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

Vector tools

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 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 type of file is MDF? ›

mdf file stands for Master Database File and is a SQL database packaged into a file. These files have an associated . ldf (Log Database File) that contains the logs for that database.

What is MDF in automotive? ›

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.

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 to convert MDF 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 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 of master database? ›

As the backbone of SQL Server, an MDF file is the default file extension used by Microsoft SQL Server for its primary data files.

How to read M4F files? ›

If you cannot open your M4F file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a M4F file directly in the browser: Just drag the file onto this browser window and drop it.

References

Top Articles
Easy Hot Pepper Jelly Recipe • foolproof!
Homemade Ranch Seasoning Mix (Copycat Hidden Valley Ranch) Recipe - The Cookie Rookie®
Genesis Parsippany
How To Do A Springboard Attack In Wwe 2K22
Free Atm For Emerald Card Near Me
Gunshots, panic and then fury - BBC correspondent's account of Trump shooting
Ncaaf Reference
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Danielle Longet
Craigslist Dog Kennels For Sale
Newgate Honda
Vcuapi
Huge Boobs Images
Sivir Urf Runes
50 Shades Darker Movie 123Movies
Metro Pcs.near Me
What Is Vioc On Credit Card Statement
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Kcwi Tv Schedule
Conan Exiles Sorcery Guide – How To Learn, Cast & Unlock Spells
Clare Briggs Guzman
Sullivan County Image Mate
Used Safari Condo Alto R1723 For Sale
Azur Lane High Efficiency Combat Logistics Plan
Craigslist Illinois Springfield
Walgreens Bunce Rd
Apartments / Housing For Rent near Lake Placid, FL - craigslist
Craigslist Lake Charles
Craig Woolard Net Worth
1145 Barnett Drive
Yayo - RimWorld Wiki
Skepticalpickle Leak
Uno Fall 2023 Calendar
Desales Field Hockey Schedule
Devargasfuneral
O'reilly's Wrens Georgia
EST to IST Converter - Time Zone Tool
All Things Algebra Unit 3 Homework 2 Answer Key
Kelly Ripa Necklace 2022
Boone County Sheriff 700 Report
Cygenoth
Craigslist Com Panama City Fl
Cnp Tx Venmo
Nail Salon Open On Monday Near Me
Frigidaire Fdsh450Laf Installation Manual
Used Auto Parts in Houston 77013 | LKQ Pick Your Part
Tyrone Dave Chappelle Show Gif
Grandma's Portuguese Sweet Bread Recipe Made from Scratch
Tenichtop
Loss Payee And Lienholder Addresses And Contact Information Updated Daily Free List Bank Of America
Elizabethtown Mesothelioma Legal Question
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6150

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.