Applies To:
  • CitectSCADA 7.00, 7.10
  • Vijeo Citect 7.00, 7.10

How should the time values be formatted when setting the OnTime, OffTime and AckTime fields using the AlmSummarySetFieldValue Cicode function?

These time fields need to be formatted as a Citect Time/Date value, which is the number of seconds since 01/01/1970. No Date fields are required because the date will be extracted from the Time/Date value. The sFieldValue argument of the AlmSummarySetFieldValue Cicode function expects a STRING, so the Citect Time/Date value needs to be converted from an INTEGER to a STRING using the IntToStr Cicode function. Below is an example of the OnTime, OffTime and AckTime fields being set to the current date and time.


FUNCTION My_LogToAlarmSummary(STRING scomment)
 INT iAlmSumBrowse, iError

   iAlmSumBrowse = AlmSummaryOpen("" , "", "My_Cluster");
     iError = AlmSummaryFirst(iAlmSumBrowse)
     WHILE iError = 0 DO
        iError = AlmSummaryNext(iAlmSumBrowse) <> 0

     iError = AlmSummaryPrev(iAlmSumBrowse) <> 0
    iError = AlmSummarySetFieldValue(iAlmSumBrowse,"Comment",scomment)
    iError = AlmSummarySetFieldValue(iAlmSumBrowse,"OnTime",IntToStr(TimeCurrent()))
    iError = AlmSummarySetFieldValue(iAlmSumBrowse,"OffTime",IntToStr(TimeCurrent()))
    iError = AlmSummaryCommit(iAlmSumBrowse)
   iError = AlmSummaryClose(iAlmSumBrowse)









 AlmSummarySetFieldValue(), OnTime, OffTime, AckTime, Acknowledge, Alarm Summary