Skip to content

Setting index of CAN channel in python API #23

Open
@mthaitjema

Description

@mthaitjema

Hi,

I am trying to load and decode an MF4 file using the python API. In the MATLAB API, the index of the CAN channel is passed to the read method:

can_idx = 8;
rawTimeTable = read(m,can_idx,m.ChannelNames{can_idx});

I could not find out how to do the same thing when using the python API. Currently my code looks like this:

db = can_decoder.load_dbc(pathToDBC)
df_decoder = can_decoder.DataFrameDecoder(db)

with open(pathToMF4, "rb") as handle:
    mdf_file = mdf_iter.MdfFile(handle)
    df_raw = mdf_file.get_data_frame()

df = df_decoder.decode_frame(df_raw)

This does decode the data, but the dataframe is not ordered in groups like when using MATLAB. Is it possible to do this with the python API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions