Alarm Notification Programmatic Interface

Use the OPC Systems component in your Visual Studio application to programmatically modify alarm notification groups. Refer to the FormConfigureAlarmNotification Form in the WinForm Example Code example for an example and how to add and modify alarm logging groups.

Refer to the Programmatic Access Alarm Notification Groups section in the Programmatic Interface – .NET Programmatic Configuration topic for all of the method syntax.

Alarm Notification CSV Export and Import

All notification groups can be exported to a CSV file by right clicking on the Local service and select Export CSV.

Note: You cannot have Excel open with the CSV file during the import as Excel will lock the file for exclusive use. First close the file in Excel, and then proceed with the import.

Getting Started – Alarm Notification

The Alarm Notification feature is used to summarize alarm totals and send e-mails based on specified filter criteria of alarm conditions.

In order to utilize alarm notification you must first define the Tag Alarm Limits as described in Configure Tags of this Quick Start section.  For a complete list of all Alarm Notification properties refer to the OAS Configuration – Alarm Notification section in this help file.

Step 1

OASStart Configure OAS application.

 

 

Load the DemoTags Tag configuration or use the new Tag configuration you have created.

Step 2

Select Configure-Alarm Notification.

Configure Alarm Notification

Step 3

Select the Local OAS Service by selecting the Select button next to the Network Node drop down.

Network Node

Step 4

Enter the Notification Group Name of Simulation in the field in the upper right.

Notification Group Name

Step 5

Check Notification Active in the Common Properties Tab.

Notification Active

Step 6

Select the Filters Tab.

Filters Tab

Notice how you can define filtering based on Alarm Priority, Alarm Groups, and Alarm Types.

Filters

Step 7

Select the notification type your would like to set up – Email, SMS or Voice. To use SMS or Voice as a notification type you will need to use the Twilio service.

7.1 For Email notifications select the Email tab

Email Tab

You can define to send alarms that meet the filter criteria to an e-mail account. Use a semicolon to separate multiple e-mail addresses.

Alarm Notification Email

 

7.2 For SMS notifications select the SMS tab

SMS Tab

To trial the functionality you can use the demo mode to send 10 notifications. To use SMS as a notification type you will need to use the Twilio service.

Alarm Notification SMS

7.3 For Voice notifications select the Voice tab

Voice Tab

To trial the functionality you can use the demo mode to send 10 notifications. To use Voice as a notification type you will need to use the Twilio service.

Alarm Notification Voice

Step 8

Select the Tags Tab

Tags Tab

With the Tags properties you can assign to automatically write alarm statistics to Open Automation Software Tags. Useful to drive an external alarm horn through a PLC or display how many alarms are currently active.

Alarm Notification Tags

 

Step 9

Select Configure-Tags and add a Boolean Tag with the name Alarm Is Active.

Add an Integer Tag with the name Number Of Alarms Active.

Add an Integer Tag with the name Number Of Alarms In Last 24 Hours.

Step 10

Return to Configure-Alarm Notification:

  • Enable the property to Set Tag When Alarm Active
    Assign the Tag name Alarm Is Active.Value
  • Enable the property to Set Integer Tag with Alarm Active Count
    Assign the Tag name Number Of Alarms Active.
  • Enable the property to Set Integer Tag with Number Of Alarms In A Given Period
    Assign the Tag name Number Of Alarms In Last 24 Hours

Step 11

Select the Add Group button at the top of the left pane to add the Alarm Notification group.

Add Group

Step 12

Select the Save button on the toolbar at the top.

Save Button

Step 13

Save the file DemoAlarmNotification.AlarmNotification in the directory C:OPCSystemsDemo.

You can specify for this configuration to load automatically when the Service starts using Configure-Options which is described also in this Training Guide.

Step 14

Return to Configure-Tags and select each tag and note that the current number of alarms and active state are updated automatically to the appropriate tag.

Overview – Alarm Notification

The OAS Alarm Notification feature is included as part of the Alarms .NET and Web Alarms products. If you want to develop server or desktop applications using WinForms, WPF or the Dotnet SDK then you would choose the Alarms .NET product. On the other hand, if you want to develop web-based applications with HTML and JavaScript the you would choose the Web Alarms product.

Both products give you the ability to configure alarm thresholds on any of your tags. This includes Digital, Low, Low Log, High, High High and Rate of Change alarm types with configurable parameters such as threshold value, delay, deadband, priority, alarm text, alarm group and more. By default, OAS stores the run-time alarm state in memory and allows you to configure alarm buffering in case of restart. OAS also provides alarm acknowledgement features through the alarm controls and its APIs.

The Alarm Notification feature allows you to send alarm notifications via E-mail, SMS or Voice. E-mail notifications are configured to send using an SMPT server. The SMS and Voice notifications are integrated with Twilio and require a Twilio account.

Alarm notifications work by configuring one or more Notification Groups. Each notification group is essentially a filter and any alarms that match the filter will trigger a notification for that alarm. This includes parameters such as alarm state, alarm type, priority and alarm group. You can create as many notification groups as you need.

Supported features:

  • Customize which alarm details are included
  • Dynamically set “To Address” using another Tag
  • Dynamically set “Phone Number” using another Tag
  • Repeat notification after time delay
  • Prevent sending multiple notifications within configurable time period
  • Acknowledge alarm by E-mail reply

View the Getting Started section on Alarm Notification to follow simple steps.

Other resources for Alarm Notification: Programmatically Access Configurations

Frequently Asked Questions – Alarm Logging

MS Access Error microsoft.ace.oledb.12.0 provider is not registered
MS Access Class not Registered System Error

For Office 2010, the following update will correct this issue.

https://www.microsoft.com/en-us/download/details.aspx?id=39664

For Office 365 (please note, by default Office365 installs the 32-bit version regardless of your system), use:

https://www.microsoft.com/en-us/download/details.aspx?id=54920

Security Login Error occurs with Open or Create routines.
View the Database Security Login topic on how to setup security logins and access writes to create, open, and read and write to the database.
The database engine language is different than the Regional Language settings of the Data Logging and / Alarm Logging Service. Data Logging updates, Alarm Logging updates, trend history, and / alarm history is not working due to invalid date format.
Go to Configure-Options-History and Enable History Date Format. Examples: yyyy-MM-dd HH:mm:ss MM/dd/yyyy HH:mm:ss

Videos – Alarm Logging

Alarm Logging and Notification

Alarm Logging to SQL Server, Oracle, MySQL, PostgreSQL, SQLite, and more. Send alarm notifications via Email, SMS, or voice.

Alarm Limits

How to setup alarm limits in real-time tag configuration.

Alarm Logging

How to setup alarm logging to SQL Server, Oracle, Access, and mySQL.

  • 00:00 – Log alarms to a database
  • 00:15 – Configure App
  • 02:05 – Database Format
  • 03:41 – Alarm visualization
  • 04:06 – More Questions

Alarm Escalation

How to escalate alarms over time.

Getting Started – Alarm Logging

The following guide provides instructions on setting up Alarm Logging for OAS.

In order to log alarms to a database or CSV file you must first define the Tag Alarm Limits.

For a list of the most common Alarm Logging properties refer to the OAS Configuration – Alarm Logging section in this help file.

Step 1: Check .NET Alarm or Web Alarm License

OAS

To use Alarm Logging the product feature Alarm .NET or Web Alarm needs to be enabled, it is included with either of these product features.

Start the Configure OAS application from the program group Open Automation Software.

Select Configure-License and verify that Alarm .NET or Web Alarm is one of the enabled products in the lower left of the form.  If you do not see either Alarm .NET or Web Alarm enabled email support@oasiot.com to update your license.

NOTE: To configure remote OAS Engines enter the IP Address or node name in the Network Node field and click on Select.

Network Node
Enabled Products

Step 2: Configure Alarm Logging

Select Configure-Alarm Logging.

Configure Alarm Logging

In the Common tab enter a unique Logging Group Name.

Logging Group Name

Check Logging Active in the Common Properties Tab.

Logging Active

Step 3: Set Alarm Filters

In the Filters tab specify what types of alarms to log along with which alarm groups and alarm priorities. Leave the ALARM GROUPS list blank to log all alarm groups.

Alarm Logging Filters

In the Nodes tab specify which OAS Engines to receive alarms from. Leave the list blank or specify localhost to log alarms from the local OAS Engine.

Alarm Nodes

Step 4: Log Alarms to a Database

Select the Database tab to log the alarms to a database table.

Database Tab

Enable Log to Database.

Log to Database

Select the database Provider to use.

Alarm Logging DB Providers

NOTE: MS Access is not supported on Linux or Docker deployments.

NOTE: When logging to SQL Azure use the SQL Server Provider and view the following guide to setup Microsoft Azure: Windows Azure Setup

Specify the database Server to connect with.

Server Property

NOTE: Not applicable for MS Access and SQLite.

When logging to SQL Server the Server name can be copied from SQL Server Management Studio when connecting to the database engine.

SQL Server Connect

When logging to mySQL set the SSL Mode.

mySQL SSL Mode

When logging to MongoDB use Add Srv if +srv option needs to be added to the Server.

MongoDB Add Srv

When logging to PostgreSQL select Enable SSL to specify a certificate.

PostgreSQL SSL

Set the Database to log to.

Alarm Logging Database

When using SQLite or Microsoft Access specify the full path of the database. Example: C:\DatabaseName.mdb for older versions of Access and C:\DatabaseName.accdb for Access 2007 and greater.

Set the Table to log to.

Alarm Logging Table

When logging to SQL Server uncheck Use Windows Authentication to specify SQL User Name Password. Leave enabled to connect using Windows Authentication.

SQL Server Windows Authentication

Enable Log One Record Per Alarm if you want to insert only one record for each alarm instance. Leave disabled to log a new record for every change in alarm state, return to normal and acknowledged.

Log One Record Per Alarm

When enabled there will only be one record for each occurrence of an alarm. If the alarm returns the normal start or acknowledged the existing record will be updated with the new information. If it is a new occurrence of an alarm a new record will be created.

Step 5: Log Alarms to a CSV File

Use the following configuration for CSV text logging:

NOTE: There is no historical replay to alarm windows with CSV logging.

CSV Configuration

Step 6: Add Alarm Logging Group

Select the Add Group button to add the Alarm Logging group.

Add Group

Step 7: Save Alarm Logging Configuration

Select the Save button on the toolbar at the top.

Load and Save

Enter a file name to be saved in C:\ProgramData\OpenAutomationSoftware\ConfigFiles directory on Windows or ConfigFiles subdirectory on Linux.

When prompted to set the file as the default configuration to load on startup select Yes.

Set Alarm Logging Default File

Alarm records should now be recorded for alarms that match the filter criteria in the Filters tab.

Overview – Alarm Logging

The OAS Alarm Logging feature is included as part of the Alarms .NET and Web Alarms products. If you want to develop server or desktop applications using WinForms, WPF or the Dotnet SDK then you would choose the Alarms .NET product. On the other hand, if you want to develop web-based applications with HTML and JavaScript the you would choose the Web Alarms product.

Both products give you the ability to configure alarm thresholds on any of your tags. This includes Digital, Low, Low Log, High, High High and Rate of Change alarm types with configurable parameters such as threshold value, delay, deadband, priority, alarm text, alarm group and more. By default, OAS stores the run-time alarm state in memory and allows you to configure alarm buffering in case of restart. OAS also provides alarm acknowledgement features through the alarm controls and its APIs.

The Alarm Logging feature allows store alarms in a database and thus gives you a history of alarms that you can then query. It supports the following providers: SQL Server, Access, Oracle, ODBC, MySQL, MongoDB, Cassandra, PostgreSQL, MariaDB and SQLite. In addition to this you can also log to CSV files.

The alarm logging works by configuring one or more Logging Groups. Each logging group is essentially a filter and any alarms that match the filter will be logged. This includes parameters such as alarm state, alarm type, priority and alarm group. You can create as many logging groups as you need.

View the following for a quick tutorial on alarm logging: Videos – Alarm Logging

FAQs – Data Logging

MS Access Error microsoft.ace.oledb.12.0 provider is not registered
MS Access Class not Registered System Error

For Office 2010, the following update will correct this issue.

https://www.microsoft.com/en-us/download/details.aspx?id=39664

For Office 365 (please note, by default Office365 installs the 32-bit version regardless of your system), use:

https://www.microsoft.com/en-us/download/details.aspx?id=54920

I receive a System Error when trying to log or access an Oracle database

OAS version 12.00.0043 now uses OracleManagedDataAccess assembly. If you are using an older version of OAS we recommend to update to the latest version. If you have upgraded from a previous version and using TNSNAMES.ORA name in the Database file please see the FAQ on TNSNAMES.ORA.

Data Logging System Error occurs with database engine error null values not allow.
The cause of this error is one or more of the database table columns has been modified  to not allow null values.  OAS creates the columns in the table to allow null values so when the data quality is bad for a tag value a null value will be inserted into the table.  The only column that should be set to not allow null values is the DateAndTime column.  There are 2 solutions to this error:
  1. Please review the columns in each table with the SQL Server Management Studio.  If they have been changed to not allow null values change them back to allow null values.
  2. Go to each logging group and enable the property Discard Null Rejects under the Database tab.  Keep in mind that with this property enabled the records to be logged that contain null values will be discarded and not logged.
Menu Configure Data Logging Discard Null Rejects
Security Login Error occurs with Open or Create routines
View the Database Security Login topic on how to setup security logins and access writes to create, open, and read and write to the database.
Data is not logged to the database engine

View the Data Logging Errors troubleshooting guide for a complete list of error causes and solutions.

View the source of the problem under Configure-System Errors.

The complete history of errors can be viewed under C:\Program Files\Open Automation Software\OAS\Log or the path that is set under Configure-Options-System Logging.

Enable Log Data Logging Transactions under Configure-Options-System Logging to see the details of each transaction and error returned from the database engine.

CSV Logging to a Remote Mapped Drive
Either enable the SYSTEM account to have read and write access to the mapped drive and directory, or set the OAS Engine Service LogOn to a user account that would have access to the remote mapped drive using these steps in setting the OAS Engine Service LogOn.
Logging to MS Access on a Remote Mapped Drive
Either enable the SYSTEM account to have read and write access to the mapped drive and directory, or set the OAS Reports Service LogOn to a user account that would have read and write access to the remote mapped drive.
Error reports LogIn failure to database engine when trying to open connection
View the following video on how to setup security in the database engine:
Direct link: /videos/#troubleshoot-connection-login
The database engine language is different than the Regional Language settings of the Data Logging and / Alarm Logging Service. Data Logging updates, Alarm Logging updates, trend history, and / alarm history is not working due to invalid date format.
Go to Configure-Options-History and Enable History Date Format. Examples: yyyy-MM-dd HH:mm:ss MM/dd/yyyy HH:mm:ss
I need to log to an Oracle database engine using the TNSNAMES.ORA file.
OAS version 12.00.0043 now uses OracleManagedDataAccess assembly which does not support TNSNAMES.ORA.  You can set the entire path from the TNSNAMES.ORA file in the Database field of the data logging, alarm logging, or recipe group directly. Use the following as the Database name: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID))) As example for a system with a computer name GWDESK and the Oracle database name OPCDb: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=GWDESK)(PORT = 1521)))(CONNECT_DATA=(SERVER= DEDICATED)(SERVICE_NAME=OPCDb)))
How much memory on the hard disk is taken up when logging to SQL Server?
The following should be used as an aid in sizing database requirements. The method used is to store 100 Tags each, of a few common data types for one hour at a 1 second continuous interval to separate tables. SQL Server 2005 Express was used to gather this information. As always your final results may vary. In SQL Server you can set the Database property under Options for Recovery model to Simple to reduce disk usage. Boolean Data type table size Rows: 3598 Reserved: 200 KB Data: 152 KB Index Size: 16 KB Unused: 32 KB Double data type table size Rows: 3598 Reserved: 3272 KB Data: 3200 KB Index Size: 16 KB Unused: 56 KB Integer data type table size Rows: 3598 Reserved: 1672 KB Data: 1600 KB Index Size: 16 KB Unused: 56 KB String data type table size (100 char / tag) Rows: 3589 Reserved: 84752 KB Data: 84552 KB Index Size: 144 KB Unused: 56 KB
Which database engine is most efficient with OPCDatabase.NET?
SQL Server provides the ability to log multiple records in one call, so using SQL Server on a local or remote server is the best choice.
Which database engine uses the least amount of disk space when logging values?
CSV files without a database are the smallest usage. SQL Server and mySQL are very comparable. Oracle uses approximately 4 times the disk space as SQL Server and mySQL. In SQL Server you can set the Database property under Options for Recovery model to Simple to reduce disk usage.
Setup SQL Server for authentication with UAC which was introduced on Windows Vista.