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