Alarming

eWON integrates an alarm feature and notification system.

For every Tag created on the eWON, you can enable alarming and define alarm levels, activation delays, etc.
If the value of the Tag exceeds the limit, then the eWON raises the alarm.

eWON has an Alarm summary and an Alarm History table.
Alarm Summary: lists all active alarms in the eWON and their current state. Alarm History: lists all the various states the alarm has gone through such as when the alarm has been raised, returned to normal, and acknowledged.
The alarm tables can be exported using Export Block Descriptors. (link to EBD section)

For every alarm state (ALM, RTN, ..) the eWON can send out notifications. The eWON can, for example, send out an SMS, an eMail or put a file on an FTP server when an alarm has been detected.

Using BASIC scripting, you can also script your own actions when an alarm is present.

Example of Basic that will send an email:

ONALARM "MyTag","goto Action"
Action:
	sendmail "myemail@mail.com","","Alarm","RTank Level too high"
	DigitalOutput@ = 1
end

Example in Java

public class TagAlarmCallback {
	public void StartDefaultEventHandler() throws Exception
	{
		DefaultEventHandler.setDefaultTagAlarmListener(new MyTagAlarmListener());
		DefaultEventHandler.runEventManager();
	}
    
    public class MyTagAlarmListener extends EvtTagAlarmListener
	{
		public void callTagChanged()
		{
			try
			{
				System.out.println("Alarm changed: "+ getTagName() + 
                " Alarm Status:" +Integer.toString(getAlarmStatus()) +
                " Alarm Type:" +Integer.toString(getAlarmType()) +
                "CurrentValue: " + Double.toString(getTagValueAsDouble()));
         
				if ("Switch".equals(getTagName()))
					if (getAlarmStatus() == TagControl.ALARM_STATUS_ALM)
						ScheduledActionManager.SendMail("ewon@ewon.biz", "sdr@ewon.biz", "", "Alarm", "Tag 'Tank' in Alarm");
					}
					catch (Exception ex)
					{
         
				}
      }
   }
    
}