How to send alarm messages from WonderWare InTouch through INS

The easiest way to send alarm messages from InTouch is by using their WW External Alarm Utility (please read below).

>>> WonderWare technote #000734

All Tech Notes and KBCD documents and software are provided "as is" without warranty of any kind.

Topic#: 000734
Created: October 1998
Updated: January 2001

The WW External Alarm utility lets you format and filter Alarm and Event messages generated by InTouch and then send the latest message back to the InTouch application as a Message tagname. This is especially useful in situations where you need to trap the last alarm message, implement custom alarm loggers, and so on. This utility is compatible with InTouch 7.0 and later.

Along with the WW External Alarm utility, we have also included a demonstration InTouch application that shows how to use the utility with a FileWriteMessage() script function call to implement your own custom Alarm/Event logger with no programming required!

A Wwextalm.ini file is also provided for you to define how you want the messages to be formatted. This is similar to configuring an Alarm History, summary or logger object.

Installing the WW External Alarm Utility and InTouch Demo Application

Download the WWExalm.zip file which contains the WW External Alarm utility and an InTouch demonstration application.

Extract the files from Wwexalm.zip, then copy Wwextalm.dll (32-bit) to the InTouch installation directory and Wwextalm.ini file to your Windows directory (example, C:\Winnt).

The InTouch demonstration application is provided in the compressed file, Testapp.zip. Uncompress the file into a separate directory and open the application under WindowViewer or WindowMaker.

M. McCulty/R. Mullins

For technical support questions, send an e-mail to support@wonderware.com.

WonderWare technote #000734  <<<

 

Configuration

  1. Copy the file wwextalm.dll from our server to your InTouch directory (normally C:\Program Files\FactorySuite\InTouch)
    You may right click on the link above and select "Save target as" in your browser.
     
  2. Copy the file wwextalm.ini from our server to your Windows directory (normally C:\Windows)
    You may right click on the link above and select "Save target as" in your browser.

    Please use the files provided by MAW Software above to continue
    The ini file can be configured to your own liking later. But just remember then to also adjust the Data Change Script below.

     
  3. Restart your computer
     
  4. Ad a memory variable to your InTouch project and name it LastAlarmString.
    (The name could be changed in the wwextalm.ini)


     
  5. Configure this tag as type memory message


     

With this all alarm messages are now copied into this memory tag and are available for use by INS.

The next strep is to configure a trigger (Data change script) that fires every time a new alarm is copied into this tag.


 

  1. Define a Data Change Script for the tag LastAlarmString


     
  2. In this script we will call the command line utility of INS (SendMsg.exe) to send the alarm as SMS message. As defined by our version of the wwextalm.ini file, the LastAlarmString is composed of the following information:

        [MessageItems]
        IncludeDate=0
        IncludeTime=0
        IncludeEventType=1
        IncludePriority=0
        IncludeAlarmType=0
        IncludeAlarmState=0
        IncludeTagname=0
        IncludeComment=1
        IncludeGroup=1
        IncludeOperator=0
        IncludeValue=0
        IncludeLimit=0
        IncludeEGU=0

    With the following sizes:
        [ItemLengths]
        CommentLength=51
        GroupLength=12

    The format of the LastAlarmString becomes therefore
    1        10        20        30        40        50        60                                 
    ALM Comment for the TestDigital Alarm                  MAWGROUP

    To extract the comment (Alarm message), we need therefore to get 51 characters, starting at character 5. For the alarm group (becomes the recipient) we look for 12 characters starting at position 56.
    In this sample we use the Group name as name of the contact list in INS (preceded by >) to receive the alarm message. If in INS there is a contact list configured with the same name as this group, the message will be sent to this contact list.

    The script that calls SendMsg.exe becomes:

    StartApp ("C:\ins\SendMsg.exe /Time " + StringChar(34) + "NOW" + StringChar(34) + " /Type " + StringChar(34) + "SMST" + StringChar(34)+ " /Recipient "+StringChar(34) + ">" + StringTrim(StringMid(LastAlarmString,56,12),3) + StringChar(34)+" /Message "+StringChar(34) + StringTrim(StringMid(LastAlarmString,5,51),3) + StringChar(34));

    LastAlarmString = " ";




    Important: Reset the tag LastAlarmString at the end of the script, to re-enable the alarm.

    To simply check on the structure of the LastAmarmString, write it into a file using
    FileWriteMessage("C:\TESTALM.LOG",-1,LastAlarmString,1);

 

 

Trouble shooting
If you experience troubles with the instruction above, please try to first run the InTouch Demo Application from the link at the top.