Email Alarm Notification

Standard quality control charts display control limits that define boundaries for the production process. In STATISTICA Enterprise, you can set alarms that will be triggered whenever a sample falls outside of those control limits. You can also define actions that will be executed whenever an alarm is triggered.

One of those actions could be to send an email that notifies the recipient that an alarm has been triggered. Here is how to configure STATISTICA Enterprise to send such emails.

First, you will need an SVB macro that generates emails. Here is the SVB code for such a macro:

' The following script demonstrates how to send a simple email message 
' from an SVB program using standard Microsoft objects. 
' This script includes references for 
'   "Microsoft CDO For Exchange 2000 Library" (CDO) 
'   "Microsoft ActiveX Data Objects 2.5 Library" (ADO) 
' You will need to change the following settings to match your situation: 
' set the address of you SMTP mail server 
' set the "From" email address 
' set the "To" email address 
' set the "Subject" line of the email 
' set the body of the email message 
' specify an attachment to the email (optional)
 
Option Base 1
Sub Main
 
Dim C As New CDO.Configuration 
Dim Fs As ADODB.Fields 
Set Fs = C.Fields 
Dim F1 As ADODB.Field 
Dim F2 As ADODB.Field 
Set F1 = Fs.Item(cdoSendUsingMethod) 
F1.Value = cdoSendUsingPort 
Set F2 = Fs.Item(cdoSMTPServer) 
F2.Value = "xxx.yyy.zzz.com" ' address of the SMTP mail server 
Fs.Update
 
Dim M As New CDO.Message 
Set M.Configuration = C 
' Who the message says it is from 
M.From = "OutOfControl@zzz.com" 
' Who the message is to 
M.To = "joesmith@zzz.com"
 
' Add date/time stamp and random number to subject line, so that 
' each email will have a unique subject line.
 
' This will help the email server to distinguish each email, and avoid 
' emails being mistakenly dropped by email server
 
    M.Subject = "Out of control point" & " " & Str(Now()) & " " & Str(10*Rnd()) 
' Body of the message
 
M.TextBody = "Widget production alarm--process out of control." 
' Attachment 
'M.AddAttachment("C:\OutOfControlProcedure.doc")
 
M.Send 
End Sub
 

StatSoft will provide a copy of this SVB macro upon request.

If manually creating this script, it must include the references to "Microsoft CDO For Exchange 2000 Library" (CDO) and "Microsoft ActiveX Data Objects 2.5 Library" (ADO).

This SVB code will need to be modified to conform to the user’s environment. The address of the SMTP mail server will be different for each environment. The From, To, and TextBody values will also need to be customized. You can also add an attachment to the email via the AddAttachment method.

Note: The Subject field has the current date/time appended to it, along with a random number. This is to ensure a unique subject line for each email. Sometimes a user can generate many emails that all have the same To, From, Subject, and TextBody fields. In this case, some email servers may have trouble distinguishing the individual emails, and some emails may be dropped by the email server. Giving each email a unique subject line will ensure that the email server can distinguish each individual email message and prevent any emails from being accidentally dropped.

Now let’s configure STATISTICA Enterprise to run that SVB email macro when an alarm is generated. In the tree view of Enterprise Manager, expand the Analysis Configuration node and select the Alarm child node, as shown in the next illustration.

In the Alarm properties page, in the Define out-of-control event (causing notification/alarm) group box, select the Sample out of control check box. Click the corresponding Define Action button to display the Define Alarm Events dialog.

Select the Run SVB Programs; program names/location check box. Then click the 1 button, browse to the SVB macro that generates emails, and select it. The file name and path will be displayed in the text box.

Note that, in this case, we are selecting the Macro from the C:\ drive. In order for all workstations to be able to run this macro, they must all have it in their C:\ drive (or place it on a shared network location accessible to all users).

Click OK.

Finally, let’s look more closely at the Check for violations group box.

To understand the first option, New samples only, you should think about it in the context of quality control charts that are set to update periodically. When the New samples only option button is selected, no alarms will be generated for out-of-control points that are present when the chart is first run. But alarms will be generated for any new out-of-control points that appear when the chart is updated. This behavior prevents alarms from being generated for old out-of-control points that show up when a chart is first displayed.

If you want alarms to be generated for out-of-control points that are present when the chart is first displayed, select the All samples option button.

Save and run the Analysis Configuration. If the resulting quality control chart has any out-of-control points, an email will be generated for each out-of-control point.