CurData and EventData with a difference of about 2 seconds

Forum Home Forums Runtime Bugs Server Bugs CurData and EventData with a difference of about 2 seconds

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #14315
    Zeus
    Participant

    The current time of the data is inconsistent with the event time, with a difference of about 2 seconds. When there are more events, the longer the difference is

    #14316
    Zeus
    Participant

    the current data time is 04:34:24 and the event time is 04:34:02 when I check data in influxdb and postgres

    #14320
    Mikhail
    Moderator

    A timestamp of the event is set by the Server service when the event is created.
    A timestamp of the data point may be changed according to the archive writing period. It depends on the archive properties.

    #14322
    Zeus
    Participant

    I set my archive period 1 second

    #14324
    Mikhail
    Moderator

    Is it possible to reproduce the problem?

    #14326
    Zeus
    Participant

    I checked the source code.

    In server corelogic line 520 method Execute(). CalcCnlData and ProcessData use DateTime.UtcNow
    in server corelogic line 1029 eventtime use another DateTime.UtcNow

    #14340
    Mikhail
    Moderator

    Yes, event has it’s own timestamp that equals to an event creation time. While archive timestamp may be different if the archive uses a writing period. But 20 seconds difference is too big if the archive period parameter is 1 second. I would be OK if the archive writing period is 1 minute for example.

    #14345
    Zeus
    Participant

    Hi
    Now I am using the event time for calculating current data. sometimes when the data changes every time. the result of my calculation is not right.
    I want to make the event time and current time in the same time line.

    #14346
    Zeus
    Participant

    Could you give me some advice?

    #14350
    JW
    Participant

    I am sharing some of my experience, not sure if they are the same case.

    Is it an input cnl or calculated cnl? what’s the refresh rate of this data cnl?

    If the data fluctuated and refreshed 10 times in 1 second, e.g. [1.9,1.9,1.9,1.8,1.9,1.8,2.1,2.1,1.9,1.8]
    the data archive will only write data of 1.9 at 0.000ms because of the sampling, so it missed the max value of 2.1.
    but the event will be able to detect the value of 2.1 and write an event.

    some time later, the data become [2.1,2.1,2.1,2.1,1.9,2.1,1.8,2.1,2.2,2.2], the data archive will record data of 2.1.

    #14356
    Mikhail
    Moderator

    The above is a good example of what I was saying.
    Also you can try to set an archive option to write data on each change. But it may require a lot of disk space if data change too fast.

    #14490
    Zeus
    Participant

    There is a new question about get history data.
    I am to trying to get silice data by event time.
    The historical data obtained through event time does not seem to match the real-time data collected

    #14492
    Mikhail
    Moderator

    Slice timestamp depends on the archive parameters that are set in the Server configuration. You should check how the archive is written.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.