ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
169 stars 73 forks source link

Cannot read FLEXARY abased .mf4/mdf version4 file. #178

Closed surendrasah closed 4 years ago

surendrasah commented 4 years ago

Python version

python 3.7

Description

I have recorded .mf4/mdf version 4 with FLEXARY on CANOE. Its not able to read the file. I am not sure if your program can read signal information from FLEXARY based .mf4.

====

reader=Mdf('test.mf4') Traceback (most recent call last): File "", line 1, in File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf.py", line 160, in init metadata=metadata) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdfreader.py", line 413, in read convert_after_read, compression, metadata) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf4reader.py", line 1323, in read4 buf.read(channel_set, info, self.fileName) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf4reader.py", line 370, in read temp = temp.load(record, info, name_list=channel_set, sorted_flag=True, vlsd=True) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf4reader.py", line 408, in load temps.update(_load_header(self.fid, self.pointer_to_data)) TypeError: 'NoneType' object is not iterable from mdfreader import mdf4reader reader=mdf4reader('test.mf4') Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable reader=mdf4reader() Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable

from mdfreader import mdf from mdfreader import Mdf reader=Mdf() reader.read('test.mf4') C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdfinfo4.py:604: UserWarning: Could not parse CG block names tag warn('Could not parse CG block names tag') Traceback (most recent call last): File "", line 1, in File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdfreader.py", line 413, in read convert_after_read, compression, metadata) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf4reader.py", line 1323, in read4 buf.read(channel_set, info, self.fileName) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf4reader.py", line 370, in read temp = temp.load(record, info, name_list=channel_set, sorted_flag=True, vlsd=True) File "C:\Users\ssah\AppData\Local\Continuum\anaconda3\envs\py3.7\lib\site-packages\mdfreader\mdf4reader.py", line 408, in load temps.update(_load_header(self.fid, self.pointer_to_data))

ratal commented 4 years ago

Hi, The error trace is not complete or at least I hardly understand it, some copy paste mistake ? I do not think flexray is specifcally the reason why mdfreader is crashing, others reporting possible to do so from CANoE with also CAN etc.. why do you think so ?

surendrasah commented 4 years ago

Hi @ratal Thanks for the response. Would you be able to guide me which set of commands/code shall i use to read the flexray .mf4 file? 20161129_IN-x1234_Erprobungsort_0000032.zip this file is based on version 4. I guess, I am using the wrong commands to execute.

ratal commented 4 years ago

Hi, Thanks for sharing this file. There is indeed a bug. Mdfreader can read in general Flexray but your specific file has one composed channel (flexray) that is Variable Length. Current code is not including this corner case yet. I will check how to fix this.

ratal commented 4 years ago

I pushed a fix in dev branch, you could have a try. By the way I found malformed VLSD channel FLX_NullFrame.DataBytes completly null.

ratal commented 4 years ago

I just released version 3.3 that include the fix, you could more easily try it.

surendrasah commented 4 years ago

Thanks @ratal . I can get the signals from my file but not the required flexray signal. I guess its because there is no fibex parse available.

ratal commented 4 years ago

Indeed mdfreader does not parse fibex files. You get only the data the way it is written in the mdf file. So you do not have signal name alone but instead frameName.signalName

ratal commented 4 years ago

I do not plan to implement fibex parser but I guess data is anyway usable, closing