Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  30 Jan 2025, Pavel Murat, Forum, converting non-MIDAS slow control data into MIDAS history format ? 
    Reply  31 Jan 2025, Pavel Murat, Forum, converting non-MIDAS slow control data into MIDAS history format ? 
    Reply  01 Feb 2025, Pavel Murat, Bug Report, MIDAS history system not using the event timestamps ? test_frontend.pyval_nightly.csv
       Reply  01 Apr 2025, Pavel Murat, Bug Report, MIDAS history system not using the event timestamps ? 
          Reply  01 Apr 2025, Konstantin Olchanski, Bug Report, MIDAS history system not using the event timestamps ? 
             Reply  02 Apr 2025, Pavel Murat, Bug Report, MIDAS history system not using the event timestamps ? 
                Reply  02 Apr 2025, Konstantin Olchanski, Bug Report, MIDAS history system not using the event timestamps ? 
Message ID: 3020     Entry time: 01 Apr 2025     In reply to: 3012     Reply to this: 3022
Author: Konstantin Olchanski 
Topic: Bug Report 
Subject: MIDAS history system not using the event timestamps ? 
> I confirm that when writing out history files corresponding to the slow control event data, 
> MIDAS history system timestamps the data not with the event time coming from the event data, 
> but with the current time determined by [mlogger].

This is correct. The timestamp in the history file is the mlogger timestamp.

In theory we could use the ODB "last_written" timestamp, but in practice,
timestamps are 1 second granularity and the difference between the two
timestamps normally would be less than 1 second. (time to react to db_watch()).

But ODB last_written also is not the data timestamp. For remote connected clients
it includes the mserver communication delay.

What is the data timestamp, only the user knows - for some FPGA based equipments,
I can see the data timestamp being read from an FPGA register together with the data.

But back to earth.

For making history plots, 1 second granularity with a small (a few seconds) delay should be okey,
and I think the mserver timestamp is good enough.

For data analysis, you are reading history data from a history data file and you are
not constrained to using the MIDAS timestamp.

You can always include your "true" data timestamp as the first value in your data.

We do this in felaview for writing labview data to midas history in the ALPHA antihydrogen experiment at CERN.

This also anticipates your next request, can we have millisecond, microsecond, nanosecond history timestamps:
since you define your "true" data timestamp, you an make it anything you want. (I use "double" time in seconds,
64-bit IEEE-754 "double" has enough precision for microsecond granularity. FPGA based devices can have timestamps
with 10 ns or 8 ns granularity, in this case a uint64_t clock counter could be more appropriate).

K.O.
ELOG V3.1.4-2e1708b5