Import of MDF4 Files

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

Note

The addin is a beta version. The release version is planned for October 2015.

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.

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
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