Replies: 2 comments 7 replies
-
I'm not sure if we are on the same page. After an initial call to the ReadEverythingButData(), the MDF files configuration is now known. Each channel group shall have a so-called master channel. This master channel is normally the relative time in seconds. When you set up the channel subscriptions, you should always include this master channel along with the data channels you want. The ReadData() call will read all samples and store these sample values into the channel subscribers. If you want the absolute start time of the measurement(s), then it's the timestamp in the header block. Note that some recorders set this time when the file was created and not when the measurement was started. |
Beta Was this translation helpful? Give feedback.
-
The absolute time of a sample is the start time + relative time. There is no obvious solution if you have more than one measurement in the file. The start time should be stored in the measurement (DG) block and not in the header (HD) block but we probably have to wait for the MDF 4.3 version. In my previous project, I stored the relative time but also stored the absolute time (uint64_t ns since 1970) as normal data channel. Note that the time channel is related to the channel group not to a channel. When storing the time channel it required to be in chronological order, why your application is responsible for doing that. You should however note that the MDF reader is quite generic but the MDF writers are not. Each writer assume a certain external behavior. Currently the writer assume that the samples comes in time order. If your application receives the values out-of-order, a new writer needs to be made. For example if you have a converter file situation, the built in cache is just annoying. The sample cache solves 2 problem. When you call InitMeasurement(), it starts a thread that is responsible of the cache. Post-mortem If the current writer or reader needs some improvement, please note that there exist a project for MDF related issues. Currently working with the Python interface. |
Beta Was this translation helpful? Give feedback.
-
Hello, Im trying to read the sample data along with the timestamp where the data was measured. Is it possible to retrive the measurement time? Thanks,
Beta Was this translation helpful? Give feedback.
All reactions