Can DIAdem Convert TDMS File to MDF File With Correct Time Info for CANape?

Updated Oct 30, 2025

Reported In

Software

  • DIAdem

Issue Details

I have the MDF4 DataPlugin registered in my DIAdem and can send the contents of its Data Portal to a new *.mf4 file, which is a common file format readable by many other data viewing tools.  However, when I have waveform channels loaded in the Data Portal, DIAdem outputs those to waveform channels in the MDF4 file, which not all external tools can interpret correctly.  As an example, Vector's CANape will create a Time channel when loading waveform channels from a *.mf4 file, yet this Time channel can have incorrect values, causing the channels to display incorrectly on the X-axis.  How can I export waveform channels from the DIAdem Data Portal to an MDF4 file that CANape will display correctly?

Solution

You need to convert the waveform channels to XY channels in the Data Portal, prior to saving them to MDF4 file.  The XY channel representation in DIAdem was designed to be compatible with the XY channel linking in the MDF4 file format, so XY channels saved from DIAdem to an *.mf4 file should be successfully read by all software tools fully compatible with the MDF4 format.  The following script has been verified to create *.mf4 files that are read and displayed correctly in CANape 12.  This particular script assumed the Data Portal contains 1 or more groups of either all waveform channels or already converted XY channels.  The WfmChnToCh() command provides the XY channel creation when you pass False in its 2nd parameter.

Dim Group, Channels, OutFilePath

' Load data set with waveform channels
Call Data.Root.Clear()
Call DataFileLoadSel(ProgramDrv & "Examples\Data\Example_data.tdm", "TDM", "[2]/*")

' For any Group with all waveform channels, converts the waveform channels to XY channels
FOR Each Group In Data.Root.ChannelGroups
  Set Channels = Group.Channels
  IF Channels.Count > 0 THEN
    IF Channels(1).Properties("waveform").Value = "Yes" THEN
      Call WfChnToChn(Channels, False)
    END IF ' 1st Channel in Group is a waveform
  END IF ' Channels.Count > 0
NEXT ' Group
Call ChnRenumber()

' Saves all channels in the Data Portal to new MDF4 file
OutFilePath = CurrentScriptPath & Data.Root.Name & ".mf4"
Call DataFileSave(OutFilePath, "MDF4")

Start with 1 or more Groups of waveform Channels        ==>          Convert to 1 or more Groups of XY Channels
              ==>