Import of MDF4 Files

The Addin converts MDF4 data files to UniPlot data files NC2.

Note

This addin is a beta version.

So far, UniPlot can read MDF files up to version 3.3 (see Import of MDF Files). The addin enables UniPlot to read and write the new format “ASAM Common MDF 4.0” of ASAM e.V.

Installation

Usage

  • Start UniPlot.

  • Choose File=>Import Data.

  • Choose Type "MDF4 File (*.mf4)".

  • Select one or more MDF files.

Bus Logging Events

Currently only CAN bus data with 8 bytes payload can be processed. All other bus system data will be ignored. To load the data, the CAN bus addin must be loaded and the appropriate DBC files must be selected. See Import of CAN Files. If the file contains bus data, the delay loading is disabled for this file and all data will be loaded.

Programming

The source code can be found in mdf4_read.ic, mdf4_write.ic and rs_mdf4.ic in the addin\rs_mdf4 directory.

Example for writing:

o = [. n = 1,
    1 = [. n = 3,
        1 = [. name = "time", data = [0.1,0.2,0.3]],
        2 = [. name = "sig1", data = [3,1,7]],
        3 = [. name = "sig2", data = [1,1,1]]]]
mdf4_create(o, "d:\\test.mf4")

API for reading:

s = mdf4_libversion()

oMDF = mdf4_open(ssFile)
oGroups = mdf4_open_groups(oMDF)
n = mdf4_groups_count(oGroups)

oGroup = mdf4_open_group(oGroups, iGroup)

oChannels = mdf4_open_channels(oGroup)
n = mdf4_channels_count(oChannels)

oChannel = mdf4_open_channel(oChannels, iChan)
data = mdf4_channel_get_data(oChannel)
mdf4_close(oMDF)

History

Version

Description

R2023.1

Supports empty cg_md_comments for group creation using cg_tx_acq_name.

R2020.1

Bus Logging for CAN Bus data (8 byte payload data) has been added. To use this feature, the CAN addin must be enabled and DBC files must be selected. See Import of CAN Files. CAN-FD, LIN, FlexRay, MOST and ETH will be added in a later version.

R2020.1

Scaling type 8 was not supported. If the scaling type occurs in the MDF4 file, the new channel attribute _nc_enum_range will be added. It contains a range min:max and a text valid for the range, separated by an | character.

R2015.6

Channel Array Block (CABlock) data is converted, if the data dimension is 1.

R2015.1

Support for compressed channels added. A number of bugs have been fixed. mdf4_dump(ssFile) improved.

R2014.2

Support for MDF-Version 4.1. Compressed data is not supported. Header data and group comments will be processed.

R2013.15

String channels are loaded. (cn_data_type = 6). Unicode channels will be saved as ANSI text.

R2013.11

The import of MDF 4 files failed, if DT-blocks contained more data than defined in cg_cycle_count.

R2013.9

bug Fix: Data blocks can contain incomplete records at the beginning and end.

R2013.8

Bug Fix: The import of MDF4 files failed, if the file contained char or complex channels. Now these channels will be ignored and will contain invalid numbers. Files containing channel groups with zero points could not be imported.

R2012.3

New.

id-2117679