- Report this article
Gurajapu Raja Sumant
Gurajapu Raja Sumant
Works in development of embedded systesms software using C/C++ for products such as PTC HVAC,EV chargers, etc. ISO26262,UDS, OBD. Located in South Korea
Published Mar 9, 2023
+ Follow
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. If you work in the automobile industry, companies share CAN/LIN debug logs in the form of mf4 files.
There are 6 benefits behind using the mf4 format. They are:
1) It can be used across various CAN tools.
2) It can support lossless recording at faster data rates e.g. CAN FD.
3) Reading from the file iaster since it is index based.
4) It is compressible which means large amount of data can be stored with a minimal space.
5) It supports both RAW and physical values. Hence it is quite useful.
6) Supported by python and matlab.
The following is the hierarchy and physical order of mdf4 file format -
https://i.stack.imgur.com/giolp.png
If you have a license for CANalyzer then you can be using it to read the mf4 files.
This article discusses the use of a python based package to read and analyze mf4 files.
Installation:
pip install asammdf[gui]
Using the python API, you can read and analyze the mf4 files. Here is an example of how it is done.
Recommended by LinkedIn
API usage
from asammdf import MDF, Signal #import asammdf f_in = input ("Enter Input MDF4 FIle :") mdf = MDF(f_in) #read mf4 data f_out = f_in.replace(".MF4", ".csv") mdf.export(fmt='csv', filename= f_out) #write to csv
GUI tool
Here I have downloaded an example CAN DBC file (sourced from openly available sources of the internet) of electric vehicles to decode the information of battery SoC percentage of popular EV's like Hyundai Kona and Kia.
This is quite useful in achieving things that target improving the quality of our automotive product or building a new one from the data that is collected.
You can also use cantools python package to read the DBC file-
https://cantools.readthedocs.io/en/latest/pip install cantools
import cantoolsfrom pprint import pprintdb = cantools.database.load_file(r'C:...dbc',strict=False)
db.message[message('Battery', 0x7ec, False, 62, None), message('Temperature', 0x7bb, False, 54, None), message('Tire', 0x7a8, False, 64, None), message('gnss_pos', 0x3, False, 8, {None: 'GNSS position'}), message('gnss_time', 0x2, False, 6, {None: 'GNSS time'}), message('gnss_attitude', 0x5, False, 8, {None: 'GNSS attitude'}), message('gnss_odo', 0x6, False, 8, {None: 'GNSS odometer'}), message('gnss_status', 0x1, False, 1, {None: 'GNSS information'}), message('gnss_altitude', 0x4, False, 4, {None: 'GNSS altitude'}), message('gnss_geofence', 0x8, False, 2, {None: 'GNSS geofence(s)'}), message('gnss_speed', 0x7, False, 5, {None: 'GNSS speed'}), message('gnss_imu', 0x9, False, 8, {None: 'GNSS IMU'}), message('gnss_pos', 0x13, False, 8, {None: 'GNSS position'}), message('gnss_time', 0x12, False, 6, {None: 'GNSS time'}), message('gnss_attitude', 0x15, False, 8, {None: 'GNSS attitude'}), message('gnss_odo', 0x16, False, 8, {None: 'GNSS odometer'}), message('gnss_status', 0x11, False, 1, {None: 'GNSS information'}), message('gnss_altitude', 0x14, False, 4, {None: 'GNSS altitude'}), message('gnss_geofence', 0x18, False, 2, {None: 'GNSS geofence(s)'}), message('gnss_speed', 0x17, False, 5, {None: 'GNSS speed'}), message('gnss_imu', 0x19, False, 8, {None: 'GNSS IMU'})]s
However, this can be done with a free 3rd party tool, Vector CANdb++ editor:
Vector CANdb++ editor is installed with the demo version of CANalyzer / CANoe, which can be downloaded from the Vector website:
Like
Celebrate
Support
Love
Insightful
Funny
23
1 Comment
Patrick Wijnen
Experienced Engineer at Signify
8mo
- Report this comment
very usefull, thanks for sharing!
1Reaction 2Reactions
To view or add a comment, sign in
More articles by Gurajapu Raja Sumant
-
What is the difference between QM and ASIL A/B in ISO26262 functional safety?
Aug 17, 2024
What is the difference between QM and ASIL A/B in ISO26262 functional safety?
ISO26262 is a standard for passenger vehicles which addresses possible hazards caused by malfunctioning behaviour of…
5
-
Embedded Linux: Start an executable as a service using daemon
Aug 13, 2024
Embedded Linux: Start an executable as a service using daemon
Embedded linux usually has code running in the application space apart from Kernel space. As an embedded developer…
10
-
Reed-solomon codes and its use in (automotive) ethernet for error correction.
Jun 23, 2024
Reed-solomon codes and its use in (automotive) ethernet for error correction.
It is common for digital signals to encounter noise and get corrupted. An automobile is a very noisy environment…
9
-
History and basics of vision guided autonomous vehicles (ADAS and ALVINN)
Apr 17, 2024
History and basics of vision guided autonomous vehicles (ADAS and ALVINN)
SAE(Society of Automotive Engineers) classifies self driving vehicles as per the standard J3016. According to this…
16
1 Comment
-
Quick sort algorithm in C++ [Tested on STM32 freertos]
Mar 24, 2024
Quick sort algorithm in C++ [Tested on STM32 freertos]
In one of my previous articles, I have proposed to build a quick sort library in c++ that can be used in embedded…
8
1 Comment
-
EV battery - Why charging a Li ion battery is quite different from Ni-Cd battery?
Mar 5, 2024
EV battery - Why charging a Li ion battery is quite different from Ni-Cd battery?
Understanding trickle charging of both the battery technologies.
The technology of Li - ion battery…
16
-
Websockets development in C++ using concepts of ASIO, networking TS and Boost beast library.
Feb 20, 2024
Websockets development in C++ using concepts of ASIO, networking TS and Boost beast library.
Introduction
OCPP is usually implemented using a component known as websockets. It is basically an extension…
15
3 Comments
-
Threadsafe Memory allocations in FreeRTOS: Static and dynamic
Feb 7, 2024
Threadsafe Memory allocations in FreeRTOS: Static and dynamic
Dynamic memory allocation in C/C++ can be done using malloc/calloc functions.
When we are done using the…
12
-
Sorting in embedded systems: Why "Quick sort" is not the perfect algorithm for an embedded system?
Jan 28, 2024
Sorting in embedded systems: Why "Quick sort" is not the perfect algorithm for an embedded system?
In my previous articles,…
9
2 Comments
-
Copy of CAN/LIN power supply (KL-30/31) cable wiring as per Automotive standard DIN 72552
Dec 30, 2023
Copy of CAN/LIN power supply (KL-30/31) cable wiring as per Automotive standard DIN 72552
DIN 72552 is a standard used by component(Tier 1/2) and vehicle manufacturers(OEM's) when creating an automotive…
5
See all articles
Sign in
Stay updated on your professional world
Sign in
By clicking Continue to join or sign in, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.
New to LinkedIn? Join now
Insights from the community
- Programming What are the most effective algorithms for real-world problems?
- Data Visualization How can you clean negative values in a logarithmic scale bar chart?
- Statistical Data Analysis How do you implement hierarchical and multilevel models in Stan and what are the benefits and challenges?
- Data Science What are the most effective methods for network analysis?
- Machine Learning What are the most effective methods to smooth time series data?
- Data Engineering How can you implement a trie for efficient string search?
- Critical Thinking How can R help you analyze data more effectively?
- Multithreading What are some examples of lock-free and wait-free data structures and algorithms in multithreading?
- Statistics How do you optimize your statistical code for efficiency and performance?
- Machine Learning How can you remove outliers from a dataset using z-score?
Others also viewed
- Getting Trendlines from Time Series Gonzalo Sanchez Pla 5y
- How to Speed Up PTV Visum Models by Running Assignments in Parallel David Aspital 3y
- Running a tidal simulation John Maskell 7y
- Stack Overflows….Oversimplified. Roberto Eger 6y
- Creating a graph with Gephi and scrapy Mihály Minkó 8y
- Visualize CO2 Time Series with Python Chonghua Yin 6y
- Floating point Issue faced practically !!! Jithendrian Sundaravaradan 11mo
- Cluster/Node/machine downtime prediction- Survival Analysis Kinshuk Sengupta 8y
- Use Joblib to Speed up Loops in Python Chonghua Yin 5y
Explore topics
- Sales
- Marketing
- Business Administration
- HR Management
- Content Management
- Engineering
- Soft Skills
- See All