ITAlmFn Script Function Library

Posted on 249 views

Introduction


The ITAlmFn Script Function Library consists of the function “WWGetAlmGroup”.
This function gets the Group (Alarm Group), given the Tagname and InTouch
Application path.


This script function is useful as it gets the Group (Alarm Group) of the
specified tag when InTouch application is running (WindowViewer). A Memory
Message Tag is used for specifying the TagName. This way Alarm Group is returned
on the fly for the specified TagName. Please note that Alarm Group can also be
obtained by using the TagBrowser Activex Control ( refer TagAccess controls )
when InTouch Application is running. But using TagBrowser Activex Control
requires that its User Interface should be visible (which may not be desired in
some cases) and that the Tag must be selected from the Tag list displayed by the
control.


Note– The ITAlmFn Script Function Library is supported
for InTouch 7.1 or later.


Installing the ITAlmFn Script Function Library


 Download
the ITAlmFn.zip file
from the Wonderware Knowledge Base.


Unzip the file that you downloaded and move the files ITAlmFn.dll,
ITAlmFn.wdf

and
ITAlmFn.hlp to
your InTouch directory. When you restart your application, the script function
should be listed alongside of the other InTouch script functions.


The script function implemented in this library is described below:


Description


WWGetAlmGroup


WWGetAlmGroup(“ITAppDirMsgTag”, “TestTag”,
“GroupMsgTag”);


WWGetAlmGroup allows the user to get AlarmGroup for the specified InTouch
Tag. The AlarmGroup is stored in GroupMsgTag, which is a Memory Message Tag.


Return value:
Return Value is zero, if the script function is successful. Otherwise a
-1 is returned and the Error Message is logged in WWLogger.


Input / Output Parameters:


ITAppDirMsgTag: Input Parameter. A string which contains the name of a
MESSAGE tag. This tag should be typically a Memory Message Tag. The Value of
this tag should be the complete path where the InTouch Application exists.


The easiest way to get the correct path for InTouch Application is to use the
script function InfoInTouchAppDir(), which is provided with the standard set of
script functions provided by InTouch. See the usage of this function in the
Example provided below.


TestTag: Input Parameter. A string which contains the name of a tag for which
AlarmGroup is desired.


GroupMsgTag: Output Parameter. A string which contains the name of a MESSAGE
tag. After the function WWGetAlmGroup is used, the value of this tag would be
the AlarmGroup name for the specified Tag.


Example:


ITAppDirMsgTag = InfoIntouchAppDir();     {Returns the current
InTouch application directory.}


Intval =
WWGetAlmGroup(“ITAppDirMsgTag”,”TestTag1″,”GroupMsgTag”);
        


Where Intval is of Integer type.


Note– The script function InfoIntouchAppDir MUST be used
before WWGetAlmGroup. This is because InfoIntouchAppDir returns the current
InTouch application directory into the InTouch Tag ITAppDirMsgTag (Memory
Message Tag), which is then used in WWGetAlmGroup. Not doing this would give
unpredictable results.

Leave a Reply

Your email address will not be published. Required fields are marked *

9 + 1 =