danielhrisca / asammdf

Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files
GNU Lesser General Public License v3.0
655 stars 226 forks source link

Flexray recorded mf4 file not being exported #273

Open surendrasah opened 4 years ago

surendrasah commented 4 years ago

Hi, I have recorded mf4 file on flexray. When i tried exporting it in csv or any other format with GUI tool, it throws exception. Can this tool be used for flxray recorded mf4 file or not?. If yes, then whats the problem. please help me out.

I am using Windows 10 and python 3.7 on Anaconda.

2019-11-28, 16:13:34

<class 'Exception'>
Traceback (most recent call last): File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\asammdf\gui\utils.py", line 150, in run self.output = self._target(*self._args, **self._kwargs) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\asammdf\mdf.py", line 1116, in export ignore_value2text_conversions=ignore_value2text_conversions, File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\asammdf\mdf.py", line 3557, in to_dataframe for channel_index in self._included_channels(group_index) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\asammdf\mdf.py", line 372, in _included_channels f"CAN_DataFrame or CAN_ErrorFrame not found in group {index}" asammdf.blocks.utils.MdfException: CAN_DataFrame or CAN_ErrorFrame not found in group 4


File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\asammdf\gui\widgets\file.py", line 1381, in export progress=progress, File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\asammdf\gui\utils.py", line 117, in run_thread_with_progress raise Exception(thr.error)

danielhrisca commented 4 years ago

Hello @surendrasah

you should not get this error, this is strange. Can you send the file so I can have a look over it?

surendrasah commented 4 years ago

Hi @danielhrisca Thanks for quick response. I have recorded this trace using CANOE on Flexray. I want to export the file as CSV so that i can extract some of signal value like velocity, steering etc.

I would really appreciate if you can show or help to read this file to extract the value or export it as CSV.

Thanks

danielhrisca commented 4 years ago

@surendrasah check the new development branch code

surendrasah commented 4 years ago

Hi @danielhrisca , thanks, I will check the new development branch. Instead of using gui, I want to read it through a program. Is there any example? There are lot of examples in you developed tool but I am not able to figure out which one is required to

  1. export the mf4 file to csv or
  2. read the file and extract all signal value.

I would really appreciate your input on this.

Thanks Surendra

surendrasah commented 4 years ago

Hi @danielhrisca I am not sure what i am missing but i am still getting same again and again after using the new release v 5.14.1 . if you can export it to csv, would you be able to help me with steps.

Thanks Surendra

danielhrisca commented 4 years ago

pip install https://github.com/danielhrisca/asammdf/archive/development.zip -I --no-deps to install the development branch code

then

mdf = MDF('file.mf4')
mdf.export('csv', 'export.csv', single_time_base=True, raster=0.1)

you may want to tune the raster argument

surendrasah commented 4 years ago

Hi @danielhrisca I guess, I was not clear with my question. I want to extract signals from mdf4 file and export it into CSV file. The attached CSV file which i got it by using above command is not at all arranged and these data are not signal values. I am looking for signal name with their values like ESP_v_Signasl for velocity. These are flexray based mdf4 file. For CAN, i can see that you need .dbc file to get better output. So for Flexray, do we have any function to use the .xml databse file of flexray to extract the value? I have alread sent you the mf4 file. please help me to extract the signal values.

from asammdf import MDF, Signal mdf = MDF('20161129_IN-x1234_Erprobungsort_0000032.mf4') speed = mdf.get('ESP_v_Signal') print(speed)

Error: : Channel "ESP_V_Signal" not found.

I can see this signal name in CANOE tool. export.zip

danielhrisca commented 4 years ago

Please see issue #259 . We rely on canmatrix for DBC parsing, but there is no fibex parser available; as such there is no _extract_flexraysignal method

surendrasah commented 4 years ago

So, it means that flexray signal cannot be extracted. Is there a way , you know of, to extract these signal. I have the fibex file, mf4 file but could not find any way to extract signals.

danielhrisca commented 4 years ago

@surendrasah @maxdd

it looks like canmatrix is starting to add Flexray and Eth support for arxml databases https://github.com/ebroecker/canmatrix/pull/426