Practical Example of Time Stamped Digital Alarms

Hi,

Does anyone have an Practical Example of Time Stamped Digital Alarms and function  "AlarmNotifyVarChange" to share? 

Below is code example from ArticleID: Q5832

******

GLOBAL INT iHandle;

 FUNCTION

SubToDig()

INT iAddCB;

      iHandle = TagSubscribe("DIGITAL1");

       iAddCB = SubscriptionAddCallback(iHandle, "TriggerTSDAlarm");

 END

 FUNCTION

TriggerTSDAlarm()

STRING sValueTimeStamp;

STRING sValueTimeStampMS;

STRING sValue;

      sValueTimeStamp = SubscriptionGetAttribute(iHandle, "ValueTimestamp");

     sValueTimeStampMS = SubscriptionGetAttribute(iHandle, "ValueTimestampMS");

     sValue = SubscriptionGetAttribute(iHandle, "Value");

     AlarmNotifyVarChange("Cluster1.DIGITAL1",StrToInt(sValue),strtoint(sValueTimeStamp),strtoint(sValueTimeStampMS),"Cluster1");

  END