79559292

Date: 2025-04-07 07:24:34
Score: 0.5
Natty:
Report link

It depends on your writer code implementation.
According to ASAM MDF documentation a sorted MDF is when you add only one channel group to each data group. Unsorted MDF is when you add multiple channel groups to a single data group.
I'm using this open source library to write the files https://github.com/ihedvall/mdflib but the actual data groups and channel groups definition depends on what you want to achive.
Each method has it's own pros and cons. Sorted MDF have a grate advantage when reading it with different reading tools, such as ETAS MDA:
"Together with the index-based access in sorted data groups, this allows to use a binary search for quickly finding the record for a certain time stamp (master channel value), i.e. to quickly jump to a certain position on the time axis. This is an important benefit for many MDF reading tools."

On the other hand, when implementing a recorder of large data sets for embeded systems you have a big advantage for unsorted MDF writing:
"Writing an MDF file with one single unsorted data group has the advantage that the records simply can be appended to the end of the file (see figure above). This “streaming” of records is very easy to implement because it avoids the necessity to buffer the records during recording. This may be important for data logger tools with restricted memory or which may be shut down by “power off” so that there is no time left for saving the buffered data"

My current implementation includes writing the data in unsorted MDF format and after finalizing the file I'm converiting it to a sorted MDF to enable all features and functionalities in the reading tools.

* If by sorted/unsorted MDF you meant the order of timestamps for each sample in the data itself, the data is always written sorted by timestamps

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Vladimir Novikov