doc/help/MDF4.md
Serial Studio Pro can export incoming telemetry to MDF4 files during a live session and replay saved MDF4 files through the same data pipeline. MDF4 is an ASAM-standard binary format for measurement data, widely used in automotive and industrial testing alongside CAN, LIN, FlexRay, and analog channels. This page covers what MDF4 is, when to pick it over CSV, and how export and playback work in Serial Studio.
For text-based logging and the broader "what file format should I pick?" comparison, see CSV Export & Playback. For project-scoped, queryable session storage with replay metadata and tagging, see Session Database.
MDF stands for Measurement Data Format. The current revision is MDF4 (also written MF4 or .mf4), standardised by ASAM (the Association for Standardisation of Automation and Measuring Systems). It was designed for the automotive ECU-test workflow, where a single recording can carry hundreds of channels at very different sample rates (a CAN bus running at 1 kHz, an analog sensor at 10 kHz, GPS at 1 Hz), all timestamped against a common clock.
Compared to CSV, MDF4 differs in three ways that matter day to day:
EngineRPM means in physical units, not just as a column index.The trade-off is ecosystem: CSV opens in anything. MDF4 needs a tool that understands the format, usually Vector CANape, NI DIAdem, MATLAB Vehicle Network Toolbox, or the open-source asammdf Python library.
flowchart LR
A["Device"] --> B["Frame Builder"]
B --> C["Dashboard"]
B --> D["MDF4 File"]
Like CSV, MDF4 export runs on a background thread and writes in batches. The dashboard never stalls.
| Aspect | CSV | MDF4 (Pro) |
|---|---|---|
| File size | Larger (text-based) | Smaller (fixed-width binary) |
| Write speed | Fine for most rates | Better for high-frequency data |
| Compatibility | Universal (Excel, Python, MATLAB, R) | Specialized (CANape, DIAdem, asammdf) |
| Metadata | Column headers only | Rich: channel names, units, conversions |
| Sample rates | One row per frame, all columns | Per-channel time base, no padding |
| Best for | General analysis, sharing | Automotive, industrial, high-rate logging |
Pick CSV for ad-hoc analysis, sharing with colleagues who don't have MDF4 tooling, or when you want to open the file in a spreadsheet without thinking about it. Pick MDF4 for long recordings at high data rates, automotive workflows that already use the format, or when channel metadata (units, conversions) matters at analysis time.
MDF4 export is toggled in the Setup panel of the main window. Turn on the MDF4 Recording switch before or during a live connection. Once it's on, Serial Studio writes every incoming frame to an MDF4 file on a background thread.
Exported MDF4 files land under your workspace directory (Documents by default) in a per-project folder, with the file named after the session start time:
Serial Studio/MDF4/<Project Name>/<yyyy-MM-dd_HH-mm-ss>.mf4
For example, a session started at 3:30:05 PM on March 17, 2026, for a project named "Vehicle Test" would produce:
Serial Studio/MDF4/Vehicle Test/2026-03-17_15-30-05.mf4
Each dataset becomes one MDF4 channel, and each project group becomes one MDF4 channel group. The exporter writes:
SourceName / GroupName for multi-source projects.<title> (raw) channel carrying the pre-transform value.units field.The API exposes mdf4Export.getStatus, mdf4Export.setEnabled, and mdf4Export.close for export, plus the mdf4Player.* family for playback. The --mdf-export flag in the Command-Line Interface turns export on at startup.
MDF4 export runs on its own worker thread and flushes to disk in batches. On modern desktop hardware, sustained high frame rates are routine. Each exported frame keeps the source-derived timestamp it was parsed with; the export path never re-stamps the data.
To replay a recorded MDF4 file:
.mf4 file in the file dialog.During playback, the MDF4 Player feeds each frame through the same data pipeline as a live connection: Frame Builder, then Dashboard, widgets, MQTT, and API. The dashboard renders exactly as it would with a live device. File export (CSV and MDF4) is suppressed while any player is open, so replaying a file does not re-record it. The player respects the original timing between frames so playback speed matches the original recording rate.
| Control | Action | Shortcut |
|---|---|---|
| Play / Pause | Start or pause playback | Space |
| Previous frame | Step back one frame | Left Arrow |
| Next frame | Step forward one frame | Right Arrow |
| Progress slider | Seek to any position in the file | Drag or click |
The current timestamp shows above the slider as HH:MM:SS.mmm.
Files exported by Serial Studio replay cleanly because the channel group structure matches the project that produced them. For files captured by other tools (CANape, vector loggers, custom acquisition systems), the player reads each channel group's data channels in file order and maps them positionally onto the currently loaded project's datasets, so the active project must define datasets in the same order as the file's channels.
MDF4 readers worth knowing:
asammdf. Open-source library, widely used for batch processing and conversion to other formats: from asammdf import MDF; mdf = MDF('file.mf4').For one-off conversions, asammdf exports MDF4 to CSV, Parquet, HDF5, MATLAB .mat, and a few other formats. This is useful when an analysis tool downstream doesn't speak MDF4 directly.
.mf4) format. asammdf handles both.? in third-party tools. Stick to ASCII for portability.