Replies: 5 comments 3 replies
-
|
@tuna-f1sh The current MDF (C++) Library can handle most reads and writes for MDF files. It is a rather bulky design that uses threads and conditions normally only available in OS for computers. The idea is to make a writer only library with limited functionality. There exist 2 types of writers, bus logger or sample value loggers. The bus loggers are simple while the sample values loggers are more complex. ZLIB is used only for compression and it is the ASAM standard that defines that library. Other libraries may work but needs to be tested. Looking at the CSS Electronics embedded solution as an example. It do not support compression and only used for bus logging. The initial plan was to use Rust but C/C++ can also be used as language. The MDF writes to a file so any Real-Time OS is not needed. For incoming samples and timestamp may need RTOS. Limitations ?
|
Beta Was this translation helpful? Give feedback.
-
|
Ah apologies, I did a search but seems GitHub projects are the only thing not searched! Thanks for explaining the threading currently being used. Yes, targeting a writer only with basic functionality was my plan too. I think compression could be included with miniz but probably best to start without. Do you have a link to the CSS Electronics embedded solution or is it private? I came across https://github.com/CSS-Electronics/mdf4-converters - seems to be the only C++ project and using an old lib. I know the new one uses mdflib. I’ve also been considering a Rust bindings crate with minimum interface for writing, since there are a few pure Rust crates but none as fully featured as your library; haven’t found one that does writing even. Didn’t consider it for embedded as think it might be a leap to do a binding crate and nostd - could be an interesting goal though. |
Beta Was this translation helpful? Give feedback.
-
|
@tuna-f1sh
The simplest solution is to keep the C++ language but removing read support. Making an embedded library that is in between the CSS and the current MDF library, could be a first approach. I would keep the design with an internal sample queue with an write-to-file thread. The internal queue is needed for the pre-trig support and for compression that saves 4MB chunks. The current library also support saving to multiple DG blocks at the same time. This means one queue/thread per DG block. Note that this requires DL/DT(DZ) handling. Technical not compression (DT->DZ) but the same mess. I'm currently adding support for meta data and it is a big change. An embedded system only need basic MD comment support, excluding the ASAM harmonized object support. There are also 2 companion libraries that could be of interest. The Sparkplug B (MQTT) pub/sub library could be used when the devices have Ethernet connections. The utility library have some event logging support including the syslog protocol. Need to investigate if these libraries already are supported. At least syslog should exist. The internal sample queue should maybe be exposed. The RTOS should have some sort of queues already. Maybe some investigations needed? At some point, the (embedded) MDF file needs to be copied to another system. Time plan:
|
Beta Was this translation helpful? Give feedback.
-
|
@tuna-f1sh |
Beta Was this translation helpful? Give feedback.
-
|
@ihedvall replying to #147 (comment) here to keep context.
I haven't used it but came across miniz in my research for #129. I would suggest compress is a stage 2 goal, unless you think it needs to be considered from the outset.
Since you mentioned Zephyr, I would suggest following their File System API. It allows the App to bring their own file system. Doesn't have to use it directly. I probably have a file.h with declaration of the required file IO functions - taking inspiration from Zephyr and matching if possible so it drops in. I guess one only needs a sub-set: fs_open, fs_write, fs_flush, fs_close? Maybe fs_stat? Then the App can define the functions to be linked at the mdflib at link time. Could have some weak definition place holders for testing.
Agreed.
Maybe make it optional? Or is there a configuration for size of temporary storage so that the lib could be tuned for the target?
A good reason to ignore for initial development and then add as an optional feature later. Also I agree with the limitations, particularly threading. With polling, one can bring their threading platform of choice to perform the polling or otherwise. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Have you considered having compile options for targeting embedded devices? I've not looked too deep but main blockers I see are the dynamic libs:
Just thinking out loud at the moment, thought I would mention here in case others have explored. Since MFD is a powerful logging format, it seems like this would be nice as a Zephyr module.
Beta Was this translation helpful? Give feedback.
All reactions