MDF File Logging on PX4 Autopilots
R2026bMDF (Measurement Data Format) is a standardized binary format
(.mf4) widely used in automotive and aerospace industries for logging
large, time-synchronized datasets. When deployed on PX4® autopilots, MDF file logging enables you to record internal Simulink® signals directly to the SD card on the flight controller without requiring
a host connection.
MDF file logging is the recommended approach for logging custom Simulink signals on PX4 hardware due to its low complexity and broad tool support.
Key Features
Industry Standard — MDF4 is an open, well-defined format (ASAM MDF) with broad adoption across automotive and aerospace measurement tools.
Optimized for Embedded Targets — Designed for sequential, high-speed logging on microcontrollers with minimal CPU overhead.
Rich Metadata — Supports signal names, units, data types, and time synchronization information within the file.
Tool Compatibility — Logged
.mf4files can be opened directly in Simulation Data Inspector (SDI), Vehicle Network Toolbox, and third-party MDF viewers.No Host Connection Required — Data is logged to the onboard SD card and can be retrieved after the flight.
Enable MDF File Logging
To enable MDF file logging for your Simulink model deployed on a PX4 autopilot:
In your Simulink model, mark the signals you want to log by selecting them and enabling data logging.
Open Configuration Parameters and navigate to Code Generation > Interface.
In the Data exchange interface section, select the Log signals to MDF file checkbox.

Build and deploy the model to the PX4 autopilot.
After the flight, retrieve the
.mf4file from the SD card.
View Logged Data
After retrieving the .mf4 file from the SD card, you can
analyze the logged data using:
Simulation Data Inspector (SDI) — Import the
.mf4file directly into SDI to visualize and compare signals. For more information, see Import Data from Workspace or File into Simulation Data Inspector (Simulink).Vehicle Network Toolbox — Use MDF file reading functions to programmatically access and process the logged data in MATLAB. For more information, see MDF Files (Vehicle Network Toolbox)MDF Files (Vehicle Network Toolbox)