I was trying out the MDFLib and was having an issue with MDF files exported from a Kvaser CAN Logger (MDF 3.2). I tracked the problem down to the GetChannelBlocks() code. The code assumed that the first channel in a group was the time channel but my MDF files have the last channel of the group as the time channel. I made the following change to the code so that the time channel is located and placed as TimeChannel for all the channels in a group.
CodeRunner, thanks for the catch. I found that issue as well recently but haven't updated the library on sourceforge yet. I've been making a few changes. Did the library work with the Kvaser files after the modification? I will add that to the list of supported applications if it works. I've been working on adding support for unsorted MDF files that are exported from CANalyzer.
If you are interested in an early beta of a new viewer send me an email and I will pass it along to you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only other issue that I had with the Kvaser 3.2 MDF files was that the channel datatype was set to 14 (little endian signed integer). Since your code already handled the 1 datatype (default byte order signed datatype) and the default order of the Kvaser MDF is little endian I just inserted "case 14:" into the MDFChannel code and that is working:
Hello,
I was trying out the MDFLib and was having an issue with MDF files exported from a Kvaser CAN Logger (MDF 3.2). I tracked the problem down to the GetChannelBlocks() code. The code assumed that the first channel in a group was the time channel but my MDF files have the last channel of the group as the time channel. I made the following change to the code so that the time channel is located and placed as TimeChannel for all the channels in a group.
Last edit: CodeRunner 2014-02-20
CodeRunner, thanks for the catch. I found that issue as well recently but haven't updated the library on sourceforge yet. I've been making a few changes. Did the library work with the Kvaser files after the modification? I will add that to the list of supported applications if it works. I've been working on adding support for unsorted MDF files that are exported from CANalyzer.
If you are interested in an early beta of a new viewer send me an email and I will pass it along to you.
The only other issue that I had with the Kvaser 3.2 MDF files was that the channel datatype was set to 14 (little endian signed integer). Since your code already handled the 1 datatype (default byte order signed datatype) and the default order of the Kvaser MDF is little endian I just inserted "case 14:" into the MDFChannel code and that is working:
CodeRunner,
Thanks for the updates! I was mistaken and didn't have your original change in the library. I've added both changes to my copy now.