The most reliable way to convert these files is using native Vector Informatik tools like CANoe , CANalyzer , or CANape .
import candas as cd import asammdf # Load BLF and DBC dbc = cd.load_dbc("./database.dbc") log_data = cd.from_file(dbc, "input.blf") # Save to MF4 mdf = asammdf.MDF() # Logic to append signals from dataframe to mdf object mdf.save("output.mf4") Use code with caution. Copied to clipboard convert blf to mf4 new
: This standalone utility or integrated feature in CANape/CANoe converts message-based BLF logs into signal-based MF4 logs. The most reliable way to convert these files
import candas as cd from asammdf import MDF , Signal # Load logs and databases log_data = cd.from_file(cd.load_dbc( " path/to/dbc " ), " input.blf " ) mdf = MDF() # Append signals to the new MF4 object for name , values in log_data.items(): mdf.append(Signal(samples=values, timestamps=log_data.index, name=name)) mdf.save( " output.mf4 " ) Use code with caution. Copied to clipboard import candas as cd from asammdf import MDF