0

I want to filter MF4 files using a signal list and import them into CANoe. For filtering I use the following asammdf code:

from asammdf import MDF 
import re

channels_to_keep=[]
filter = open(signallist.lab,'r')
inputMF4 = bigData.MF4
mdf = MDF(inputMF4)
all_channels = mdf.channels_db
for row in filter:
    row = re.sub('\n', '', zeile)
    if row in all_channels:
        channels_to_keep.append(zeile)
    
new_mdf = list(filter(None, channels_to_keep))
mdf.filter(new_mdf).save(dst='smallData.MF4')

I can't import the new File in CANoe (Maybe he looses Metadata?) However i can open the File in CANape and see all Channels.

if i just cut the origin File in smaller Pieces using:

short=mdf.cut(start=starttime, include_ends = True)
short.save()

then i can import the File like always.

Why does asammdf lose information, or rather how can I filter by Channels and import the new file?

Is it possible that asammdf exports a signal-based MF4 by default?

Jacob
  • 77,566
  • 24
  • 149
  • 228
  • What _asammdf_ version do you use? What channels are found in the lab file? – danielhrisca Jun 22 '20 at 16:52
  • im using asammdf v5.20.2. In the signal list I have specified certain channels which are also contained in the large file. Even if I write all channels from the big file into the signal list, so he should not filter at all, a 50MB file will be compressed to a 30MB file. – OfficerTryhard Jun 23 '20 at 04:55
  • if you don't filter the channel ``CAN_DataFrame`` then the metadata needed by CANoe is not transferred to the new file: – danielhrisca Jun 24 '20 at 05:55

0 Answers0