Showing results 1 to 5 of 5

Thread: Alarm filter VSTA

  1. #1
    Join Date
    30.09.2010
    Posts
    14

    Default Alarm filter VSTA

    Hello,

    We would like to make a alarm filter in VSTA. Is it possible?

    Best Regards,

    Daan van Genderen

  2. #2
    Join Date
    20.08.2009
    Posts
    293

    Default Re: Alarm filter VSTA

    Hi,

    what are you trying to do?
    Did you take a look on the Alarm Message List Filter picture type?

    If this does not fulfill your requirements, there is the possibility to use the filter of a picture switch function to the Alarm Message List Picture in VBA/VSTA.

    You have to create a picture switch function to your alarm picture in the Editor (in my example "dummyfilter", see code below), where you can set some predefined settings. This settings can be manipulated via VBA/VSTA in the Runtime via the DynProperties of the function (also see code below).

            //Function to get the filtered alarms
            public void Macro_GetFilteredAlarmItems()
            {
                zenOn.IAlarm zAML;
                zenOn.IAlarmItems zAML_Items;
                zenOn.IAlarmItem zAML_Item;
    
                Int32 i; 
    
                string[] DynProps; 
    
                zAML = this.Alarm();
    
                //Show PictFilter DynProperties - Debug (DynProperties can also be shown via XML - Exporting the Function)
                DynProps = (string[])this.RtFunctions().Item("dummyfilter").get_DynPropertiesEnum("PictFilter");
                foreach (string s in DynProps)
                {
                    System.Diagnostics.Debug.WriteLine(s);
                }
                
                //Manipulate the function (here the VarFilter is set to "ivar2")
                this.RtFunctions().Item("dummyfilter").set_DynProperties("PictFilter[0].VarFilter", "ivar2");
    
                //Apply the alarm filter
                zAML_Items = zAML.AlarmItems("dummyfilter");
    
                //iterate through the filtered alarms
                for (i = 0; i < zAML_Items.Count; i++)
                {
                    zAML_Item = zAML_Items.Item(i);
                    PrintAlarm(zAML_Item);
                }
    
            }
    
            //Function for printing the alarm information 
            public void PrintAlarm(zenOn.IAlarmItem myAlarmItem)
            {
                System.Diagnostics.Debug.WriteLine("Comes " + myAlarmItem.Timecomes + "\r\n");
                System.Diagnostics.Debug.WriteLine("Goes " + myAlarmItem.Timegoes + "\r\n");
                System.Diagnostics.Debug.WriteLine("Ack " + myAlarmItem.Timequitted + "\r\n");
                System.Diagnostics.Debug.WriteLine("Text " + myAlarmItem.Text + "\r\n");
                System.Diagnostics.Debug.WriteLine("Variable " + myAlarmItem.Name + "\r\n");
                System.Diagnostics.Debug.WriteLine("Value " + myAlarmItem.Value + "\r\n");
            }

    Take also a look here how to get the DynProperties:
    http://www.copadata.com/forums/showthread.php?t=1004


    Regards,
    Bernhard
    Last edited by bernhardf : 25th October 2010 at 13:30

  3. #3
    Join Date
    30.09.2010
    Posts
    14

    Default Re: Alarm filter VSTA

    Hello Bernhard,

    We have a batch process where every batch have a specific number.
    In a database table insert I the batch number with Start and End Time.

    Now will we look wich alarm have occurred by a specifiek batch number.

    My tought was: make a function in vsta who, adjust a filter where the results place in the alarm message list.

    Regards,

    Daan van Genderen

  4. #4
    Join Date
    20.08.2009
    Posts
    293

    Default Re: Alarm filter VSTA

    Hi,

    yes, this should work by adapting the appropriate DynProperties of the picture switch function.

    If you take a look on the XML Export of a picture switch function you see these properties:

    Click image for larger version

Name:	dynprops.PNG
Views:	70
Size:	20.3 KB
ID:	487

    Which you also get via DynPropertiesEnum (property and datatype)
    (http://www.copadata.com/forums/showthread.php?t=1004)

    Click image for larger version

Name:	dynpropsvsta.PNG
Views:	57
Size:	18.7 KB
ID:	488



    Regards,
    Bernhard

  5. #5
    Join Date
    30.09.2010
    Posts
    14

    Default Re: Alarm filter VSTA

    Tanks for you fast replay.

Similar Threads

  1. CEL Filter
    By hicom in forum zenon Supervisor
    Replies: 2
    Last Post: 24th August 2010, 11:51
  2. Setup a filter at design time
    By matholton in forum zenon Supervisor
    Replies: 2
    Last Post: 3rd October 2008, 08:40
  3. flash-filter in the editor
    By markclemens in forum zenon Supervisor
    Replies: 0
    Last Post: 16th October 2007, 15:58

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •