Possible for Milestone Server to alter timestamp on AlarmHistory?

We have an application which processes Alarms into groups based on common names and displays them together. The group, called an Alert, has a Created property which is pulled from the earliest AlarmHistory’s timestamp. In this case, the Created property turns out to be 13 minutes earlier than the timestamp on the AlarmHistory.

Here is how we pull the timestamp from the AlarmHistory (AlarmLinesWithHistory is filled with calls to IAlarmClient.GetAlarmHistory() and IAlarmClient.GetAlarmLines()):

AlarmHistory[] firstMemberHistory = alarm.AlarmLinesWithHistory.Last().AlarmHistory;
Created = firstMemberHistory.First().Time.ToLocalTime()

And the relevant data from the log says the Created property is 12:59:28 but the only AlarmHistory for the entire Alert has the timestamp 13:12:45 (same day). Is it possible the server mangled the timestamp somehow?

It is because AlarmHistory has an alarm history, this means it has multiple time. When changing the alarm status, alarm history increases its history including time. Let me explain what we did.

Open AlarmEventViewer sample - https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/alarmeventviewer/readme.html&tree=tree_2.html

Add one line around 337 in LoadClientAlarm() in MainForm.cs, like this -

foreach (AlarmLine line in alarms)
{
    Alarm alarm = alarmClient.Get(line.Id);
    AlarmHistory[] ah = alarmClient.GetAlarmHistory(line.Id); // add this line to see Alarm History
    DataGridViewRow row = new DataGridViewRow();
    row.Tag = alarm;

Put a break point on the line “row.Tag = alarm;” to see time and timestamp.

Run the sample.

See alarm.EventHeader.Timestamp and Alarm history time, it is the same time (if the alarm has only one status).

Press F5 until Alarm and Event Viewer Application dialog comes up.

When you see the dialog, select an alarm which has status 1 from the alarm list.

Click “In Progress” and see the status number changes from 1 to 4.

Click Events radio button and click Alarms radio button again.

Then go back to the break point.

It shows you the AlarmHistory(ah) is increasing, ah[1] has start time but ah[0] has time of changing the status to “In Progress”.

Hi Rie!

I’m familiar with the nature of AlarmHistory in that it is an array of events that have occured on the alarm; What’s strange is that there is only one AlarmHistory element for this particular alarm (at the time of logging), despite what was pulled into the Created property having a different time from that single AlarmHistory element. So I wonder if an individual AlarmHistory instance (not the array but a single AlarmHistory class instance) can have its Timestamp changed?

Thanks,

Derek

Hi Derek! Sorry for the late response.

“In this case, the Created property turns out to be 13 minutes earlier than the timestamp on the AlarmHistory.”

  • How and when are you checking the timestamp on the AlarmHistory which is 13 minutes later?

  • If you have a set of steps to reproduce your observation, they would help us to further understand your situation! An MRE is always helpful :+1: