Get a list of point's annotations from mimic script in ClearSCADA


15 April 2021


This sample program is intended to demonstrate one or more programming functions or methods and is presented as programming example only. Schneider Electric assumes no liability for the use or application of this example program or any portion thereof.

This example shows how historic annotations can be accessed from a mimic script. The example retrieves historic annotations for a point named "Discharge Flow" Located in a group named "Flow Information". The time window is set to 5 hours from the current time. The results get displayed in a list box.

Sub RetrieveAnnotations

Form.Init("List of Annotations")

Set TestPoint = Server.FindObject("Flow Information.Discharge Flow")

RangeEnd = TestPoint.Interface.CurrentTime
RangeStart = DateAdd("h", -5, RangeEnd)

NoteCount = TestPoint.Interface.Historic.AnnCount (RangeStart, RangeEnd)

Set oList = form.AddListBox(1,1,15,1)
For i = 0 to NoteCount - 1
    AnnotationComment = TestPoint.Interface.Historic.AnnComment (RangeStart, RangeEnd, i, 1)
    AnnotationTime = TestPoint.Interface.Historic.AnnTimestamp (RangeStart, RangeEnd, i, 1)
    AnnotationUser = TestPoint.Interface.Historic.AnnUser (RangeStart, RangeEnd, i, 1)
    AnnotationModTime = TestPoint.Interface.Historic.AnnModifyTime (RangeStart, RangeEnd, i, 1)
    ListBoxEntry = "Time: " & AnnotationTime & ";  Comment: " & AnnotationComment & ";  User: " & AnnotationUser & ";"  
    oList.Add ListBoxEntry


End Sub