Overview

Alarms are elements of fundamental importance in a SCADA system. Alarms signal when an event occurs, allowing the system or the human monitor to take appropriate action. Events may occur, for example, when a device encounters an abnormal condition or when a parameter being monitored falls outside a normal range. In some cases the system may be able to automatically provide the desired response, such as sending a corrective signal to a device. In other cases human monitors need to be informed, by a visual display, an audio signal, or a remote message.
In FactoryStudio, alarms are associated with tags. An alarm may be triggered when a tag reaches a certain value, or when it falls outside a certain range. Alarms may be linked to standard responses such as visual displays or sounds. Alternately, custom code may be provided to create almost any desired response.
Alarms are assigned priorities, so that the most urgent can be handled if there are multiple alarms at the same time. Also, for convenience, alarms are organized in groups, and each group shares some common properties. In particular, an alarm's group determines if and how the alarm must be acknowledged, and if and for how long it should be recorded in the system log.
To minimize spurious alarms, a time interval may be established before each alarm may be triggered after system startup, and a minimum time may be set before the same alarm can be triggered again.

Configuring Alarms and Events

Alarm Groups

Every alarm and system event belongs to an alarm group. Alarm groups allow you to configure common settings for a collection of alarms. The group settings determine such things as whether an acknowledgment is required, whether a sound plays, what is logged, and how alarms display.
FactoryStudio comes with several predefined alarm groups that you can use, and you can create your own groups as well.
The predefined groups are:

To configure alarm groups:

The Audit Trail


The audit trail provides a log of selected system events for a specified length of time.
To configure the Audit Trail:


The Alarm Database


The database used to store the Alarms is defined in Edit-Datasets-DBs by the database connection object with the name AlarmHistorian.
By default, when a new project is created, the AlarmHistorian is defined to use the Tatsoft built-in embedded SQL database TatsoftDB.
The TatsoftDB database should be used for databases up to 10GB. If it is expected to create more than 10GB, you should define another SQL for Tag Historian Database.
In order to define another Database to store the Alarm Historian database, you need to create a new database connection, as explained on "Configuring Database Connections" on page 105, and name it AlarmHistorian.
The system does not allow duplicate names, so to create a DB connection with the name AlarmHistorian you must rename or delete the existing row using that name.
The Alarm Module automatically creates the required tables in the database. An example of table schema is available opening any file with extension .TAlarm, created when running application using the default TatsoftDB as the alarm logging database.

Alarm Visualization


To visualize alarms and events, you can use the built-in object on the displays or reports. See section "Configuring an Alarm Window" on page 150 for more information.

Acknowledgments and Subscriptions

Acknowledging Alarms

There are several methods for acknowledging alarms:

Acknowledge All Alarms
You can use the <Alarm.AckAll> property that acknowledges all active Alarms .
Acknowledge Single Alarm or Highest Priority Alarm
The <Alarm.PriorityItem.UnAck> property allows acknowledgment of the highest priority Alarm configured in <Edit.Alarms.Items> the "Priority" column if there is a pending ack alarm.
Acknowledge a Specific Alarm
To acknowledge a specific alarm use the <Alarm.Items.IDxx.Unack> property.
To verify the contents of the IDxx Alarm columns, go to Alarm item and add the ID column (right-click in the table and select "ID").

Subscriptions to Notifications

In order to apply custom actions using .NET scripts, you can subscribe to notifications of alarms and events.
These notifications are typically used to send SMS or email warnings, execute custom calculations, add custom notification messages or audio alarms, text-to-speech audio alarms, and to perform any kind of action defined by custom programming.
To subscribe to alarm events, create a method in any Script Class of type Server, with the following prototype:
void Notification(AlarmEventInfo\[\] info)
\\
Finally, select that method on Edit > Alarms >Groups at the NotificationMethod Column. 
The name of the method can vary. What is important is the expected parameters. The AlarmEventInfo structure is defined in the namespace Alarm on the runtime classes reference, [<span style="color: #293dd0"><a href="http://www.tatsoft.com/help/fs-2014/runtime/index.html" class="external-link" rel="nofollow">http://www.tatsoft.com/help/fs-2014/runtime/index.html</a>.</span> |http://www.tatsoft.com/help/fs-2014/runtime/index.html]
\\

The Alarm Namespace


The Alarm namespace has the properties of the Alarm server.
The Alarm.Group object has the list of all defined groups and their properties.
The Alarm.Item object has all alarm items and their properties.
The following tag properties are connected with the Alarm module:
tag.tagname.Hi: configuration and runtime status of the HI alarm, similar names for the other alarm types.
See http://www.tatsoft.com/help/fs-2014/runtime/index.html for the complete programming reference on runtime objects.